ProgrammingModerate

int c = 0; for (int i = 0; i < 3; i++) for (int j = 0; j < 3; j++) { if (i == j) continue; c++; } printf("%d", c); What is printed?

  1. A. 6
  2. B. 3
  3. C. 9
  4. D. 0

Correct answer: A. 6

The nine pairs minus the three with i == j leave six pairs that increment c.

More C Programming questions

Exams that ask this topic