ProgrammingHardTCS NQT · Infosys

for (int i = 0, j = 10; i < j; i += 3, j -= 3) count++; How many times does the body run?

  1. A. 2
  2. B. 3
  3. C. 4
  4. D. 1

Correct answer: A. 2

The pairs are (0,10), (3,7) and then (6,4), which fails i < j. The body runs twice.

More C Programming questions

Exams that ask this topic