+ 1
Output-0000000... Why???
Could someone please tell me why the output of this code is like this??? https://code.sololearn.com/c2J02l1EFexk/?ref=app
5 Réponses
+ 1
because x = 0
it isn't increasing with every iteration of the loop.
add x++; in the loop.
+ 3
3 conditions are necessary for a loop-
1. Initialization (x=0)
2. Termination (x<10)
3. Incrementation (Where is this?)
+ 2
According to the code, X is always 0.
So the while statement is excuted eternally.
+ 1
Ok..now i understand. Thanks everyone.
0
Should i add x++ inside the while loop???