-
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 invoking printxy (1,1) is
-
- 0, 0
- 0, 1
- 1, 0
- 1, 1
- 0, 0
Correct Option: C
int * Ptr;
X = 0;
Ptr = & X
Y = *Ptr
⇒ (Y = 0)
*Ptr = 1;
⇒ (X = 1)
So, the output of invoking print XY(1, 1) is
⇒ (1, 0)
Hence, option (c) is correct.