ProgrammingModerate

int c = 0; for (int i = 1; i <= 100; i++) if (i % 7 == 0) c++; printf("%d", c); What is printed?

  1. A. 15
  2. B. 13
  3. C. 100
  4. D. 14

Correct answer: D. 14

The multiples of 7 up to 100 are 7, 14, ..., 98, which is 14 numbers.

More C Programming questions

Exams that ask this topic