ExamVeda
Login
Home
This question belongs to C Program Pointer
Pointer
?

What will be the output of the following program code?
#include <stdio.h>
void main()
{
    int i=3, *j, **k;
    j = &i;
    k = &j;
    printf("%d%d%d", *j, **k, *(*k));
}

Answer & Solution
Correct Answer: Option C
Let's discuss the solution. Join the discussion
Examveda
Question posted by Examveda
Community

Join the Discussion

2 Comments
Rachana Landge
Rachana Landge 4 years ago
Suppose here we take address of i=1000 , j=2000, k=3000.
j=&i ; i.e. j=1000 i.e. *j = *(1000) --> *j=(3);
k=&j i.e. k=2000 i.e. *k = *(2000)
*k = *(1000)
*k = (3);
Hence Output is i=3 , j=3 ,k=3.
Adarsh Malick
Adarsh Malick 10 years ago
solution: *j==i aur,

**k means *j and *j mean i.
aur *(*k)means*j and *j means I

then,
333 ans


*j means i