What will be the output of the following C code?
#include <stdio.h>
int main()
{
int n;
scanf("%d", n);
printf("%d\n", n);
return 0;
}
#include <stdio.h>
int main()
{
int n;
scanf("%d", n);
printf("%d\n", n);
return 0;
}A. Compilation error
B. Undefined behavior
C. Whatever user types
D. Depends on the standard
Answer: Option B

Join The Discussion