GATE 2010 CSE Q. NO. 11

(A) 2 2 (B) 2 1 (C) 0 1 (D) 0 2

Explaination :

In main function we are passing the address of i and j in function f()
and collecting the addresses in pointer variable p and q respectively.

Now we are assigning the content of q to the p

So *p=2 will change value at address 650008.
so the value of j is now 2.
and value of i is not changed.
So the output is 0 2

Categories C

Leave a Comment