Question 14380 – DSSSB PGT 2018 Female
February 5, 2024NTA UGC NET Dec 2023 Paper-2
February 6, 2024Question 9025 – GATE 2010
What does the following program print?
#include
void f(int *p, int *q)
{
p = q;
*p = 2;
}
int i = 0, j = 1;
int main()
{
f(&i, &j);
printf("%d %d n", i, j);
getchar();
return 0;
}
Correct Answer: D
Question 11 Explanation:

Both pointers points to j = 1
now *p = 2
where j is updated with value 2.
printf (i, j) i = 0, j = 2
2 2
2 1
0 1
0 2
