🎙 Free live masterclass · Sun, 29 Nov, 7:00 pm IST · Java Full Stack roadmap Register free →
Skills101
← Quiz: C Pointers: all 10 questions

Quiz: C Pointers · Question 4 of 10

What does this print? (code)

What does this print?

#include <stdio.h>
int main(void) {
    int a[] = {1, 2, 3};
    int *p = a;
    p++;
    printf("%d", *p * 10);
    return 0;
}
  1. A.10
  2. B.20
  3. C.30
  4. D.11
Answer & explanation

Correct answer: 20

After p++, p points to a[1] = 2, so 2 × 10 = 20.

Can you get the rest right without peeking?

Take the timed Quiz: C Pointers quiz free. Pass it to earn XP and count towards your certificate.

Start the quiz →