ProgrammingModerate

for (char c = 'a'; c <= 'e'; c += 2) putchar(c); What is printed?

  1. A. abcde
  2. B. ac
  3. C. bd
  4. D. ace

Correct answer: D. ace

c takes a, c and e in turn. The loop body prints each letter once.

More C Programming questions

Exams that ask this topic