void main()
{
int I=5,*j,**k;
j=&I;
k=&j;
printf("%d%d%d",*j,**k,*(*k));
}

What is the output of the above program code?

Options
- 666
- 000
- 555
- 655


CORRECT ANSWER : 555

Discussion Board
Explanation-

I=5 // suppose, address of I is 101
j=&I; // j=101 it means j points to I because j is '*' type

Address(memory location) of j=1004
Value at *j = 5 & j=101


k=&j; // k=1004. It means k points to j & j points to I.
Value of k=1004, *k=101, **k / *(*k) =5

Hence, the output is 555


Sapna 02-16-2017 06:27 AM

Learn C

nice and clear explanation


MAYURI 10-20-2016 10:26 AM

c

how we got 555

kavin 06-20-2015 12:38 AM

explanation of answer

here i=5;and also declare two pointer variable *j,**k.
*=value at address operator
&="address of operator"
explain---every value as an address.so take i has an address 1000.which is take in j.also taken j has an address value 2000 which is taken into k.

1.j=1000,so*j means value at 1000 which is 5;
2.k=2000,so**k means value at 2000 which is 1000 and again
value at 1000 which is 5(for two *);
3.k=2000,so*(*k) is same is like that =5

so output is 555.
if you have any doubt then contact me.skype id=avishekg664

avishek ghosh 07-3-2014 12:59 AM

about output

plzzzzz give explanation about output means how we got the output

bhavika 03-18-2014 02:09 PM

Write your comments


Enter the code shown above:

(Note: If you cannot read the numbers in the above image, reload the page to generate a new one.)


Advertisement