Courses
Courses
Code Compiler
Code Compiler
Discuss
Teams
Log in
Register
Menu
Q&A Discussions
Search
Search
Ask a question
Ask a question
In data types example why void main() is not there? Why int main()?
data-types
0 Votes
2 Answers
26th Jan 2019, 7:40 AM
hetvi Ashokbhai parikh
#include <stdio.h> #define square(x) x*x int main() { int i=(28/square(4)); printf("%d",i); return 0; }
define
0 Votes
2 Answers
1st Sep 2020, 10:42 AM
Rohit Ahuja
#include <stdio.h> int main() { int a[5]={1,2,3,5,8}; int first,second =0; for(int i=0;i<=4;i++) { if (a[i]>first ) {
array
3 Votes
5 Answers
14th Jul 2018, 5:07 AM
IShiva SHreya
#include <stdio.h> int main() { int x = 5; if (x<1); {printf("Hello");} }
help
0 Votes
2 Answers
15th Dec 2019, 2:33 PM
Avantika Nagrale
Why there is no semicolon at the end of the line static void main()
c#
output
2 Votes
3 Answers
1st Apr 2017, 5:47 AM
Rakesh Chandra Dash
What is the output of this program? #include<iostream> int main() { int k=6,m=1; k-=k; m=m+k; cout<<k<<" "<<m; return 0; }
c++
3 Votes
17 Answers
20th Aug 2016, 10:07 AM
Muhammed cp
int main() { int n=100; cin >> n; int sum=0; for (int n=1; n<=100; n++){ sum+=n; } cout<<sum; }
c++
programming
0 Votes
8 Answers
31st Dec 2022, 1:30 PM
Alex Boso Nzaphila
#include <iostream> using namespace std; int main() { cout << "Hello world!"; return 11; } is something wrong
program
0 Votes
8 Answers
18th May 2018, 3:08 PM
Shivam Kumar
Why int is used before main() in hello world. It's not an integer though. ?
c++
1 Vote
4 Answers
18th Dec 2018, 12:16 PM
Aditya Rathore
Pleade Explain output of this code int main() { cout <<1+"hello"; return 0; }
c++
0 Votes
2 Answers
1st Nov 2019, 10:23 AM
Somvir Dhaka
#include<stdio.h> #include<math.h> int main() { float a,b,c,s,area; printf("ENTER THE THREE SIDES OF A TRIANGLE REPECTIVELY");
pls
-2 Votes
4 Answers
17th Sep 2020, 5:37 AM
MSD
#include <iostream> using namespace std; int main() { //print "C++ is cool" return 0; }
answer
it
please
1 Vote
2 Answers
7th Oct 2021, 7:05 AM
Trupti Giri
In C++ do you prefer main() to return a void or an int?
c++
error
functions
programmingpractices
return
value-types
0 Votes
3 Answers
30th Sep 2017, 3:52 AM
GW III
#include <iostream.h> #includd<ctype.h> void Secret(char Msg[],int N); void main() {char SMS[]="rEPorTmE"; Secret (SMS,2); cout<
c++
0 Votes
4 Answers
1st Aug 2017, 5:11 PM
vishal kalbande
why there is an blank/next line between header file and main() function of c program?
c
2 Votes
4 Answers
25th Jan 2018, 6:51 AM
ShriekDj
#include <iostream> using namespace std; void printSomething(int x) { cout << x; } int main() { printSomething(42); }
<b>
1 Vote
4 Answers
14th Apr 2018, 12:20 PM
TOKOLLO COLLEN
Write a method class showData() that will display the data of both the objects from the main() method.
java
0 Votes
11 Answers
4th Apr 2017, 6:15 AM
amit
C++
{
*p
int
main()
0 Votes
7 Answers
1st Mar 2021, 4:09 AM
Aminu Abdulkadir
#include <iostream> using namespace std; int main() { int a[]={1,2,3,4}; for(int x=0;x<4;x++) { a[0]+=a[x]; }
c++
1 Vote
2 Answers
3rd May 2019, 3:06 AM
Husaain Naqvi
#include <iostream> using namespace std; int main() { cout<<12+"good morning\n"-24; return 0; }
c++
1 Vote
1 Answer
4th May 2017, 6:20 PM
siddiqui junaid
#include <iostream> int main() { int i=8,j=3,x; x=i++; j=++i; cout<<x; cout<<--j<<j--<<++j; return 0;}
c++
output
1 Vote
2 Answers
7th Feb 2017, 1:02 PM
Vaaru
#include<stdio.h> union terca{ int a; int b; }; int main() { union terca v; v.a=10; v.a=20; printf ("%d",v.a);
c
programming
union
1 Vote
6 Answers
24th May 2021, 3:16 AM
Maniprakash V
#include <iostream> using namespace std; int main() { int a=1 ,b; a=b; cout << b+a; return 0; }
variables
1 Vote
8 Answers
25th Jan 2019, 6:42 AM
Akash Kumar
What type of function is main() function? Whether is it built-in or user defined?
functions
0 Votes
2 Answers
4th Jan 2021, 1:24 PM
Imran Azad
#include <stdio.h> int main() { int i,n; char a[100]; gets(a); n=strlen(a); for(i=0;i<=n;i++) { printf("%s",a[n-i]); }
c
0 Votes
2 Answers
2nd Dec 2021, 2:10 PM
Karthik C
#include <iostream> using namespace std; //Compiler version g++ 6.3.0 int main() { int myVariable = 10; "Cout" << "myvari
print
0 Votes
7 Answers
26th Aug 2020, 11:11 AM
JASHANPREET SINGH
#include <iostream> using namespace std; int main() { int x=2; cout <<(x-++--x); return 1; }
c++
data-types
0 Votes
4 Answers
25th Sep 2016, 12:40 PM
Sourabh Goyal
#include <stdio.h> int main() { int var1,var2; var1=10; var2=10; var2=2*(++var1+2) - 2*(--var1-2); printf("Var1=%d \n Var2=%
c
1 Vote
1 Answer
25th Mar 2019, 10:17 PM
Gab
is this code wrong # include <iostream> using namespace std; int main() { int age; cin>> age; switch(
c++
0 Votes
6 Answers
17th Feb 2020, 9:52 PM
MÆŘEÁLT
Is writing int before cout necessary i.e int main() { cout<<"hello world";
c++
-1 Vote
1 Answer
7th Oct 2016, 7:59 AM
ashish mehta
When we should use void main() and when to use int main()..!
1 Vote
1 Answer
24th Nov 2016, 2:35 PM
Tanu Purohit
How to passing string array from function to main() by references [c++]
array
c++
reference
1 Vote
1 Answer
2nd Dec 2017, 9:42 AM
Asyraf Ilias
Do I need to write the methods declared before main() in algorithm?
c++
0 Votes
1 Answer
6th Aug 2016, 5:28 PM
Learner
# include <iostream.h> # include <std.h> int main() { cout<<"hello world"; return 0; }
c++
2 Votes
2 Answers
30th Jan 2018, 3:26 PM
Sakshi
Why main method can't be final in java?
final
java
main()
override
2 Votes
6 Answers
2nd Jul 2018, 4:05 AM
Jain Rishav Amit
#include <stdio.h> struct student{ char *c; }; int main() { struct student s[2]; printf("%ld",sizeof(s)); return 0; }
struct
0 Votes
5 Answers
11th Sep 2020, 8:20 AM
Rohit Ahuja
can u write a c++ program in all caps? like :#INCLUDE<IOSTREAM. H> VOID MAIN() { COUT<<"CHALLENGE";}
c++
1 Vote
5 Answers
24th Mar 2017, 6:08 AM
Vishvambar Panth
I'm stuck on def main() function in importing modules, can someone give an example?
import
into
temp
temperature
1 Vote
1 Answer
4th Apr 2018, 12:17 AM
Aaron
#include <iostream> using namespace std; int main() { //modify the given statement cout << "C++"; return 0; }
solo
0 Votes
6 Answers
5th Nov 2021, 8:44 AM
Eman Mohamed Salem Mohamed
class person{ private : int age=8; public : person(int age){ cout<<this->age; } }; int main() {person p(2);}
c++
output
0 Votes
6 Answers
5th Jul 2017, 2:17 PM
Kushagra Agarwal
Can we overload the main() method in java? If yes then which will be executed first?
java
0 Votes
3 Answers
9th Apr 2019, 3:01 AM
Avinash Maurya
#include<stdio.h> int main() { int i,j,k; for(i=1;i<=3;i++) { k = i; for(j=1;j<=i;j++) { printf("%d ", k
c
0 Votes
3 Answers
2nd Aug 2021, 8:38 AM
Husnain Ansari
#include <iostream> using namespace std; int main() { string s = "SoloLearn"; cout << (s[1]==s[3]); }
c++
1 Vote
2 Answers
28th Mar 2023, 11:44 AM
Muhammad Bilal
#include <stdio.h> int main() { int i=3; if(!i) i++; i++; if(i==3) i+=2; i+=2; printf("%d",i); return 0; }
if
0 Votes
4 Answers
21st Aug 2020, 9:15 AM
Rohit Ahuja
What are header files and can we add more than one main() functions?
c
0 Votes
1 Answer
9th Mar 2021, 8:29 PM
Hateem Arshad
What is the effect on my code if I declare the header files after main() in C or C++?
c
c++
1 Vote
9 Answers
6th Mar 2018, 6:16 PM
Arihant Jain
Why is the output '0'. But declaring array in main() gives a garbage value(as it should)...??
c++
2 Votes
3 Answers
11th Nov 2017, 5:04 PM
Saransh Bhatia
does all the code in C++ should be written inside main() function only....????except the class, function.....
answer
please
question
the
1 Vote
4 Answers
27th Apr 2017, 8:11 AM
Paavan Gupta
Can we reassign the variable values in main() function by using the user defined function (return type || void )? In C
c
doubt
in
2 Votes
9 Answers
17th Oct 2020, 6:47 AM
Yogeshwaran P
#include <stdio.h> void main() { float x = 0.1; if (x == 0.1) printf("Sanfoundry"); else printf("Advanced C Classes"); }
c
c++
2 Votes
3 Answers
16th May 2020, 12:56 AM
𝒱𝑒𝓃𝑜𝓂𝑜𝓊𝓈
Ask a question
Ask a question
Ask a question
Ask a question
< Previous
1
...
5
6
7
...
10
Next >
Hot today
How to use the get() method
3 Votes
Game Dev Path
4 Votes
How to get account back?
1 Votes
why is this platform infested with web devs
3 Votes
So this what I'm trying to solve
2 Votes
PHP Tutorial Idea
1 Votes
Problem whit Javascript
1 Votes
Use Python for string manipulation and sorting.
1 Votes
So how do I create python file and be able to code in it?
0 Votes
How to open the test cases on sololearn I tried so many times with the correct code
0 Votes