What is the output of the following program ? #include<stdio.h> void f(int *p,…
TPSC Computer/IT Posts 2026
What is the output of the following program ?
#include<stdio.h>
void f(int *p, int *q) {
p = q;
*p = 2;
}
int i = 0, j = 1;
int main(void){
f(&i, &j);
printf("%d %d\n", i, j);
}- A.
2 2
- B.
2 1
- C.
0 1
- D.
0 2
Attempted by 353 students.
Sign up free to check your answer
Sign up freeLoading lesson…

