+ 1

What is the output of this code?

// C++ program int main() { int i = 0; while ( 0 ) { printf( "%d\n", ++i ); if (i == 5) break; } return 0; }

1st Oct 2017, 7:36 PM
Lizandro
Lizandro - avatar
3 Answers
+ 4
no output because while loop is False (0)
1st Oct 2017, 7:59 PM
MBZH31
MBZH31 - avatar
+ 4
i would guess nothing becaus 0 is equal to false in the while loop
1st Oct 2017, 7:37 PM
Chrizzhigh
Chrizzhigh - avatar
+ 2
no output
1st Oct 2017, 8:35 PM
Tasmi Sultana
Tasmi  Sultana - avatar