What will be the output of the following C code?
#include <stdio.h>
int i;
int main()
{
extern int i;
if (i == 0)
printf("scope rules\n");
}
#include <stdio.h>
int i;
int main()
{
extern int i;
if (i == 0)
printf("scope rules\n");
}A. scope rules
B. Compile time error due to multiple declaration
C. Compile time error due to not defining type in statement extern i
D. Nothing will be printed as value of i is not zero because i is an automatic variable
Answer: Option A

Join The Discussion