1.

What will be the output of the following C code?
#include <stdio.h>
void fun(int*);
int main()
{
int n = 101, *ptr = &n;
fun(ptr++);
}
void fun(int *ptr)
{
printf("%d n", *ptr);
}

A. Garbage value
B. 101
C. Segmentation fault
D. Compilation Error
E. None of these
Answer» C. Segmentation fault


Discussion

No Comment Found