🎙 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 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;
}
  1. A.5
  2. B.15
  3. C.10
  4. 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 →