Gate CS-2015-3 Question Paper With Solutions

 

Q. 51 Consider the following C program

# include   int main( )  {    static int a[] = {10, 20, 30, 40, 50};    static int *p[] = {a, a+3, a+4, a+1, a+2};    int **ptr = p;    ptr++;    printf("%d%d", ptr - p, **ptr};  } 

The output of the program is _______

(A) 140

(B) 120

(C) 100

(D) 40

Answer: (A)

Explanation:

Gate CS-2015-3 Question Paper With Solutions Gate CS-2015-3 Question Paper With Solutions

Learn More:   Gate CS-2011 Question Paper With Solutions

LEAVE A REPLY

Please enter your comment!
Please enter your name here