0
Solve this
What is answer and why? int a=2; int b=3; while(--b) { ++a cout<<a ; }
9 Respostas
+ 6
Again, 34!
I suggest you use a pen and paper and write down this program on it. Then trace the code flow and count how many times variable a is incremented.
+ 5
Trace it my friend. BTW, your code have some syntax error.
+ 5
int a=2;
int b=3;
while(--b) // first loop: b=2, a=3
// second loop: b=1, a=4
// third loop: b=0 and exit
{ ++a
cout<<a ;
}
+ 5
Keep learning. Good luck.
+ 4
Most likely my friend
0
but answer is 5
0
I got the same question in challenge bro
0
so the challenge answer is wrong??
0
thanks bruh