in Unknown Category edited by
304 views
0 votes
0 votes

Find the output of

#include <stdio.h>
void main()
{
    int k =5;
    int *p = &k;
    int **m = &p;
    **m = 6;
    printf("%d",k);
}
  1. 5
  2. 6
  3. Junk value
  4. Compile time error
in Unknown Category edited by
by
304 views

2 Comments

K = 6 is the answer
1
1

option b

1
1

1 Answer

1 vote
1 vote

Ans- 6

first k gets value = 5.

pointer p points to k i.e p has address of k.

pointer to pointer m has address of p.

**m=6; // it access the data of k and makes it 6.

print k // prints 6.

https://onlinegdb.com/rJVHW2Y_G