Question 128

What is the value of count after the loops? int count = 0;

What is the value of count after the loops? int count = 0; for (int i = 1; i <= 3; i++) for (int j = 1; j <= i; j++) count++;
  1. A4
  2. B6
  3. C9
  4. D3
Show answerHide answer

Correct answer: (B) 6

Explanation

1 + 2 + 3 = 6.

From DSSSB TGT Computer Science Full Mock Test 3

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