What will be the output of the following C code?
#include
void main()
{
#ifndef max
printf("hello");
#endif
printf("hi");
}
Answer: B
The code shown above illustrates the preprocessor directive #ifndef. If the identifier checked is not defined, then the statements following #ifndef are executed. Here, since the identifier max is not defined, the statement after #ifndef is executed. Hence the output is: hellohi