ProgrammingModerate

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

  1. A. 4
  2. B. 5
  3. C. 6
  4. D. 33

Correct answer: B. 5

i takes the values 1, 3, 9, 27, 81, and the next value 243 exceeds 100.

More C Programming questions

Exams that ask this topic