ProgrammingModerateAccenture · Cognizant

What is printed?

What is printed?
int x = 10;
int *p = &x, **pp = &p;
printf("%d", **pp + *p * 2);
  1. A. 30
  2. B. 20
  3. C. 40
  4. D. 12

Correct answer: A. 30

**pp and *p both reach x = 10. * (multiplication) binds tighter than +, so the value is 10 + 10 × 2 = 30. '40' adds before multiplying.

More C Programming questions

Exams that ask this topic