Question 128

What is the output? int i;

What is the output? int i; for (i = 0; i < 10; i += 3); printf("%d", i);
  1. A10
  2. B9
  3. C3
  4. D12
Show answerHide answer

Correct answer: (D) 12

Explanation

The semicolon ends the loop; i goes 0, 3, 6, 9, 12 and the loop exits at 12.

From DSSSB TGT Computer Science Full Mock Test 1

This is question 128 of DSSSB TGT Computer Science Full Mock Test 1. 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.