What will be the output of the following C code?
#include
void f()
{
#define sf 100
printf("%d",sf);
}
int main()
{
#define sf 99;
f();
printf("%d",sf);
}
Answer: A
Macro definition is global even if it is appears within the function scope. In this case the macro sf is defined in the function f(). Hence it results in a compile time error.