What is the output? int i = 0;
What is the output?
int i = 0;
while (i++ < 3)
printf("%d", i);
Show answerHide answer
Correct answer: (D) 123
Explanation
Checks 0 < 3 then prints 1; 1 < 3 prints 2; 2 < 3 prints 3; 3 < 3 fails.
Correct answer: (D) 123
Explanation
Checks 0 < 3 then prints 1; 1 < 3 prints 2; 2 < 3 prints 3; 3 < 3 fails.
This is question 127 of DSSSB TGT Computer Science Full Mock Test 4. See all questions of this paper with answers, or attempt the paper as a timed online test to get your score and all-India rank.