← 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;
}
- A.10
- B.20
- C.30
- 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 →