ProgrammingHard

int a = 7; int b = a++ * 2; printf("%d %d", a, b); What is printed?

  1. A. 8 14
  2. B. 7 14
  3. C. 8 16
  4. D. 7 7

Correct answer: A. 8 14

The post-increment uses the old value 7 in the multiplication, so b is 14, and a is incremented to 8.

More C Programming questions

Exams that ask this topic