What will be the output of the following C code?
#include <stdio.h>
int x;
void main()
{
m();
printf("%d", x);
}
void m()
{
x = 4;
}
#include <stdio.h>
int x;
void main()
{
m();
printf("%d", x);
}
void m()
{
x = 4;
}A. 0
B. 4
C. Compile time error
D. Undefined
Answer: Option B

Join The Discussion