What is the output of following C program? (MCQ) #include<stdio.h> int * fun()…
What is the output of following C program? (MCQ)
#include<stdio.h>
int * fun()
{
int q = 10;
int *p;
p = &q;
return p;
}
int main()
{
int *res;
res= fun();
printf("%d", *res);
return 0;
}
- A.
Undefined behaviour
- B.
10
- C.
Compile error
- D.
Run time error
Attempted by 492 students.
Sign up free to check your answer
Sign up freeLoading lesson…

