ProgrammingModerate

int x = 10; int *p = &x; *p += *p * 2; printf("%d", x); What is printed?

  1. A. 30
  2. B. 20
  3. C. 40
  4. D. 12

Correct answer: A. 30

*p is 10, so *p += 20 gives 30, and x is updated through the pointer.

More C Programming questions

Exams that ask this topic