Here's the code with a full explanation.
void printxy(int x, int y) {
int *ptr;
x=0; /*The value of x is now 0.*/
ptr=&x; /*Assigning the address of x to ptr.
It means ptr points to the address of x.
So *ptr=0 as x = 0.
*/
y=*ptr; /*Assigning the value that the ptr holds, to y
y=0 as *ptr=0.
*/
*ptr=1; /*Assigning 1 to the value that the ptr holds.
It means x=*ptr=1 as ptr points to the address of x.
So the value of x is now 1.
*/
/*Therefore, x=1 and y=0 now */
printf(“%d, %d”, x, y); /*It will give the output as 1, 0 */
}
Note that the function will print the same value no matter what the parameters are passed into it.
So the correct answer is C.