ProgrammingVery hardGATE CS · Campus placements

for (int i = 0; i < 10; i++) for (int j = 1; j < 10; j *= 2) count++; How many times does count increase?

  1. A. 40
  2. B. 45
  3. C. 50
  4. D. 100

Correct answer: A. 40

The inner loop runs for j = 1, 2, 4 and 8, which is 4 times for each of the 10 outer iterations, giving 40.

More C Programming questions

Exams that ask this topic