🎙 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 6 of 10

What does this print? (code)

What does this print?

#include <stdio.h>
int main(void) {
    int x = 10;
    int *p = &x;
    int **pp = &p;
    **pp = 25;
    printf("%d %d\n", x, *p);
    return 0;
}
  1. A.10 25
  2. B.25 25
  3. C.10 10
  4. D.Compile error
Answer & explanation

Correct answer: 25 25

pp points to p, which points to x, so **pp is x itself. Changing it changes x, and *p reads the same x.

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 →