Examveda
Examveda

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));
}

A. 444

B. 000

C. 333

D. 433

E. Garbage Value

Answer: Option C


This Question Belongs to C Program >> Pointer

Join The Discussion

Comments ( 2 )

  1. Rachana Landge
    Rachana Landge :
    1 year 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.

  2. Adarsh Malick
    Adarsh Malick :
    7 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

Related Questions on Pointer