Database-Management-System
October 17, 2023
STQC-NIELIT STA 2021
October 17, 2023
Database-Management-System
October 17, 2023
STQC-NIELIT STA 2021
October 17, 2023

GATE 2017 [Set-2]

Question 14

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

A
0, 0
B
0, 1
C
1, 0
D
1, 1
Question 14 Explanation: 
printxy (int x, int y)
{
int *ptr;
x = 0;
ptr = &x;
y = *ptr;
*ptr = 1;

}
printxy (1, 1)
Correct Answer: C
Question 14 Explanation: 
printxy (int x, int y)
{
int *ptr;
x = 0;
ptr = &x;
y = *ptr;
*ptr = 1;

}
printxy (1, 1)
0 0 votes
Article Rating
Subscribe
Notify of
0 Comments
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x
error: Alert: Content selection is disabled!!