Vidyalelo
C Programming · Q195

Pointer

Programming · C Programming · question 195

Q195

What will be the output of the following C code? #include int main() int i = 97, *p = &i; foo(&i); printf("%d ", *p); void foo(int *p) int j = 2; p = &j; printf("%d ", *p);

A.
2 97
Answer
B.
2 2
C.
Compile time error
D.
Segmentation fault/code crash

Answer: Option A

Solution

Answer: Option A
No explanation is given for this question Let's Discuss on Board