← Quiz: C Pointers: all 10 questions
Quiz: C Pointers · Question 1 of 10
What does this print? (code)
What does this print?
#include <stdio.h>
int main(void) {
int x = 5;
int *p = &x;
*p = *p + 10;
printf("%d", x);
return 0;
}
- A.5
- B.15
- C.10
- D.An address
Answer & explanation
Correct answer: 15
*p is x, so x becomes 5 + 10 = 15.
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 →