What is the output for the following code snippet? #include <stdio.h> struct…
What is the output for the following code snippet? #include <stdio.h> struct emp { int age; struct emp *ptr; }; int main(){ struct emp var={24,NULL}; struct emp *ptr = &var; ptr->ptr = ptr; printf("%d %d", ptr->age,ptr->ptr->ptr->age); }
- A.
24 24
- B.
0 0
- C.
NULL NULL
- D.
Undefined behaviour (Runtime error)
Sign up free to check your answer
Sign up freeLoading lesson…

