Gate CS-2017-2 Question Paper With Solutions

Q. 35 Consider the following function implemented in C:

void printxy(int x, int y)
{
    int *ptr;
    x = 0;
    ptr = &x;
    y = *ptr;
    *ptr = 1;
    printf("%d,%d", x, y);
}

The output of the printxy(1,1) is

(A) 0,0

(B) 0,1

(C) 1,0

(D) 1,1

Answer: (C)

Explanation:

Gate CS-2017-2 Question Paper With Solutions

Learn More:   Gate EC-2010 Question Paper With Solutions

LEAVE A REPLY

Please enter your comment!
Please enter your name here