ProgrammingHardTCS NQT · Infosys

int a[] = {10, 20, 30}; printf("%d", *a + 2); What is printed?

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

Correct answer: A. 12

*a is a[0] = 10, and adding 2 gives 12. The dereference applies before the addition.

More C Programming questions

Exams that ask this topic