Cours
Cours
Compilateur de code
Compilateur de code
Discuter
Équipes
Se connecter
S'inscrire
Menu
Discussions Q&R
Chercher
Chercher
Poser une question
Poser une question
Do you have to have "int Variable = #;" in int main() or can it be outside of the {}'s?
int
integer
main
variable
0 Vote
3 Réponses
6th Nov 2020, 11:32 PM
amaIeltayib
Predict the output of the given program ? #include<iostream> using namespace std; int main() { int m=7,k=3; k+=m++; m=++k; k=k++; m+=++k; cout<<m<<" "<<k; return 0; }
c++
4 Votes
11 Réponses
20th Aug 2016, 5:37 PM
Muhammed cp
#include <iostream> using namespace std; int main() { int a; for ( a = 10; a <= 100; a+=10){ cout << a << endl;
c++
for
loops
8 Votes
5 Réponses
6th May 2017, 2:32 AM
MUʜAMMED ɪʟʟYAS
#include <iostream> using namespace std; int main() {int a, b, sum= a+b; cout << "Enter 1st number \n"; cin >> a; cout << a <<
ggy
2 Votes
3 Réponses
4th Jul 2018, 4:24 PM
Haruki
#include <iostream> using namespace std; int main() { int x; int i=3; x=++i + i++; cout << x; return 0; }
c++
3 Votes
3 Réponses
16th Jul 2016, 3:09 AM
s v sagar sagar
#include<stdio.h> int main() { char x,y; int i; x='F': i=x-'A'; y=x-'F'+65; printf("%d %c", i,y); return 0; }
c
-2 Votes
3 Réponses
22nd Apr 2021, 7:36 AM
It's Me
int add(int *,int *); int main() { int a,b; scanf("%d %d",&a,&b); add(&a,&b); } int add(int *x,int *y) { int sum=*x+*
by
call
reference
0 Vote
2 Réponses
17th Jan 2020, 6:50 AM
LIKITHA S
why this output 2 not 3 ? #include <iostream> using namespace std; int main() { int x=1; x=x++; cout<<++x; }
c++
0 Vote
5 Réponses
25th Aug 2016, 12:33 PM
Lekhraj Singh
#include <string> #include <iostream> using namespace std; int main() { string colour = "black" ; cout <<" chge"; return 0;}
c++
0 Vote
2 Réponses
31st Jul 2018, 9:01 PM
Piyush Goyal
#include <stdio.h> int main() { char a = getchar(); printf("You entered: %c", a); return 0; }
input
output
0 Vote
1 Réponse
26th Mar 2019, 4:53 PM
hetvi Ashokbhai parikh
int main() { int i=4; int ii=i*i; int iii = ii*i; cout <<iii/ii-i<<endl ; //Outputs 0 return 0; }
code
output
1 Vote
3 Réponses
3rd Jul 2017, 10:09 AM
Kushagra Agarwal
why int main() is situated in the middle of the code ,but nor in the start of the code ,and it’s correct???
c
0 Vote
5 Réponses
1st Dec 2020, 9:53 AM
Aleks kryzhanivskyi
void func(int* i, int* j) { *i=*i * *i; *j=*j * *j; } int main() { int i=2, int j=3; func(&i, &i); Printf("%d, %d", i, j);
c
c++
1 Vote
6 Réponses
31st Mar 2021, 5:59 AM
Muhammad Usman Ali
what is output of given code void func(int x) { x+=6; } int main() { static int x; func(x); cout<<x; return 0; } // zero output explanation given below
c++
2 Votes
10 Réponses
14th Jun 2016, 11:05 AM
Dev!L
#include <iostream> using namespace std; int main() { int i=0; for(;i<5;i+=3){ i=i*i; }cout<<i; return 0; }
cpp_output
0 Vote
1 Réponse
21st Oct 2017, 6:00 AM
Sharad Suryavanshi
#include <stdio.h> void main() { int x = 1, z = 3; int y = x << 3; printf(" %d\n", y); }
arithmetic
c
0 Vote
3 Réponses
14th Jan 2021, 11:30 AM
yogesh
#include using std::cout; int main() { int i=0; cout << (i=0? 1:2? 3:4); return 0; }
c
-3 Votes
3 Réponses
14th May 2020, 11:31 PM
Md Saiful Islam
#include <stdio.h> int main() { int x[5] = {20, 45, 16, 18, 22}; printf("The element is %d\n", x[5]); /* 32766 */
arrays
-2 Votes
3 Réponses
23rd Jan 2022, 4:35 AM
Diya Mehta
What does this mean: The line return 0; terminates the main() function and causes it to return the value 0 to the calling proces
return0
1 Vote
4 Réponses
25th Oct 2017, 4:15 PM
BLAQking
why output llo? could explain? #include <iostream> using namespace std; int main() { char *pString="hello"; pString+=2; cout<<pString; }
c++
1 Vote
2 Réponses
23rd Aug 2016, 10:48 AM
Lekhraj Singh
#include <stdio.h> #include<string.h> int main() { char a[60]; char b[60]; char c[]="is the friend of"; char d[]; printf ("The f
pleasehelp
0 Vote
2 Réponses
18th Feb 2022, 5:23 AM
Bong Rush Gaming YT
#include<stdio.h> void main() { int i=2, j=3; printf("%d\n",func(i,j));} int func(int a,int b) { a=a-5; b++; return(!a+- -b);}
c
-4 Votes
2 Réponses
28th Feb 2021, 3:43 PM
Ish Jaiswal
#include <stdio.h> int main() { int k,sum ; printf("number of terms in series = %d", k); scanf("%d",&k); sum = k*(k-1)/2; print
c
1 Vote
2 Réponses
12th Aug 2019, 3:44 AM
Rahul Sikarwar
#include <iostream> using namespace std; int main() { cout<<(0==0); return 0; } why the output is 1??
c++
0 Vote
2 Réponses
18th Sep 2016, 3:53 PM
Krishna Vashista
Can I do this instead: #include "std_lib_facilities.h" int main() { cout << "Hello, World!\n"; return 0; }
c++
0 Vote
2 Réponses
5th Aug 2016, 3:06 PM
jigoku_tenshi
Is this the correct program?? If so why it is not working?? #include<iostream.h> #include<conio.h> void main() { clrscr(); cout<<"hello world! "; getch(); }
c++
0 Vote
6 Réponses
11th Jul 2016, 3:47 PM
sherry
what is the meaning of the int main(int nNumberofArgs, char* pszArgs[])
c++
int
intmain()
main()
0 Vote
1 Réponse
25th Jun 2018, 6:26 AM
Lucky
Why does an int pass a value when defined outside the main() function, but not inside for a for loop?
c++
1 Vote
3 Réponses
1st Jan 2017, 8:53 PM
Zachery Mills
Is it important that java program should have main () method??is it possible that program may run without main()
java
1 Vote
2 Réponses
20th May 2017, 4:06 AM
harshita koshta
#include <iostream> #include <string> using namespace std; int main() { char *p= "this"; p+=2; char c= 1 + *p; cout <<c;
c++
code
0 Vote
4 Réponses
3rd Jul 2017, 5:09 PM
Kushagra Agarwal
#include <stdio.h> int main() { int a, b; float salary = 56.23; char letter = 'Z'; a = 8; b = 34; int c
c
-2 Votes
5 Réponses
30th May 2021, 4:29 PM
Manash Anand
In java, Can a main() method be Overloaded? Or not? If Yes is your answer please explain me with an simple example.
challenge
corejava
on
1 Vote
4 Réponses
7th Nov 2017, 1:18 PM
Saikrishna
If my program is designed as main() calls foo() calls boo(), how many stack frames will be created?
stack
0 Vote
1 Réponse
13th May 2020, 9:11 AM
Jai
#include<stdio.h> int main() { int i=-3, j=2, k=0, m; m = ++i || ++j && ++k; printf("%d, %d, %d, %d\n", i, j, k, m);
c
0 Vote
4 Réponses
4th Jun 2020, 3:25 PM
Sourabh Malviya
#include <iostream> using namespace std; int main() { int num = 1; while (num < 7) { cout << "Number: " << num
sa
0 Vote
3 Réponses
23rd May 2019, 5:22 AM
alif sadam
#include <iostream> using namespace std; int main() { cout<< "Alcacer 2 goals, CR7 1 goal"; cout<< "CR7 is old like Chi
c++
variables
1 Vote
3 Réponses
8th Nov 2017, 10:27 AM
EGENTI PRECIOUS C.
Why in C++ randomize() go out of scope when I decleared it in main() and included the header file stdlib. h????
c++
1 Vote
3 Réponses
18th Sep 2017, 7:49 PM
Captain Aniket
#include <iostream> using namespace std; int main() { int num = 1; int number; int total = 0; while (num <= 5)
loops
-1 Vote
2 Réponses
25th Oct 2020, 1:43 PM
Sada
Can somebody help me with Match Results the course is go my code: func main() { results := []string{"w", "l", "w", "d", "w",
code
course
go
have
help
i
is
my
please
the
0 Vote
2 Réponses
20th Jul 2021, 4:41 PM
Michael smith
#include <iostream> using namespace std; int main() { int num = 7; while (num > 6) { cout << "Number: " << num;
loops
0 Vote
3 Réponses
25th Apr 2018, 6:22 AM
Aditya Mehta
void main() { int a=3,b=4,c=6; printf("℅d ℅d ℅d"); getch(); } The output of this program is 6 4 3 why? can anyone explain this?
c
java
0 Vote
5 Réponses
19th Aug 2016, 6:09 PM
sree lekha
main() be overloaded in java....java and cpp both are obeject oriented...why programmer does not overloaded main function in c++
c++
java
0 Vote
2 Réponses
12th Oct 2017, 5:24 AM
Ashish Patel
What is the output of this code? #include <stdio.h> int main() { do { printf("Hi"); } while(5,3,0); return 0; }
c
codecoach
codeplayground
-1 Vote
1 Réponse
26th Oct 2020, 6:22 AM
Suman Kumar Dey
#include <iostream> using namespace std; int main() { int i = 3; i = ++i + i++; cout<<i; return 0; }
c++
0 Vote
3 Réponses
8th Aug 2016, 8:49 PM
Michael Murandu
Can you declare functions after the main () or it should be only be declared before main() so that it can be invoked
functions
1 Vote
2 Réponses
3rd Jun 2019, 12:24 PM
Kapil xtio
#include <iostream> using namespace std; void test(int*, int*); int main() { int a = 5, b = 5; cout << "Before changing:" <
c++
dev
-1 Vote
2 Réponses
5th Jul 2022, 1:34 PM
Kathleen Joy Uy
how output 26? #include <iostream> using namespace std; int main() { int x=1; for(;x<5;x++) { x+=x; cout<<x; } }
c++
0 Vote
2 Réponses
23rd Aug 2016, 5:12 AM
Lekhraj Singh
#include <iostream> using namespace std; int main() { int i=20,j=10; do {j+=i; i++;} while(j<=200); } how many times loops will run and output of "j"????
c++
1 Vote
5 Réponses
2nd Oct 2016, 6:21 PM
Omar Al Fahad
Void main() { Int x = 10; Int *y = (&x); Int ***z = (&y); Printf("%d %d %d", **z, *y, x); }
c#
-2 Votes
4 Réponses
19th Mar 2017, 6:14 AM
lalith narayan
why this output 5 and why not 2? #include <iostream> using namespace std; void func(int &x) { x=5; } int main() { int x=2; func(x); cout<<x; }
c++
0 Vote
7 Réponses
24th Aug 2016, 3:18 AM
Lekhraj Singh
Poser une question
Poser une question
Poser une question
Poser une question
< Précédent
1
...
7
8
9
10
Suivant >
Aujourd'hui en vedette
What's wrong with this code ? ( Beginner)
4 Votes
Pig Latin
0 Votes
Someone can help me
0 Votes
Square Roots
0 Votes
What's wrong with this?
2 Votes
Currently learning C++, I’m getting into socket programming with C++
0 Votes
Is there any new bug in the projects reply sections?
1 Votes
I’m new someone can help me
0 Votes
What's doctype htMl
2 Votes
HTML community, HELP!!
0 Votes