What will be the output of the following C code?
#include <stdio.h>
void f();
int main()
{
#define max 10
f();
return 0;
}
void f()
{
printf("%d\n", max * 10);
}
#include <stdio.h>
void f();
int main()
{
#define max 10
f();
return 0;
}
void f()
{
printf("%d\n", max * 10);
}A. 100
B. Compile time error since #define cannot be inside functions
C. Compile time error since max is not visible in f()
D. Undefined behaviour
Answer: Option A

Join The Discussion