What will be the output of the following C code?
#include <stdio.h>
enum m{JAN, FEB, MAR};
enum m foo();
int main()
{
enum m i = foo();
printf("%d\n", i);
}
int foo()
{
return JAN;
}
#include <stdio.h>
enum m{JAN, FEB, MAR};
enum m foo();
int main()
{
enum m i = foo();
printf("%d\n", i);
}
int foo()
{
return JAN;
}A. Compile time error
B. 0
C. Depends on the compiler
D. Depends on the standard
Answer: Option A

Join The Discussion