What will be the output of the following C code?
#include
#define sf 10
main()
{
if(sf==100)
printf("good");
else
{
printf("bad");
sf=100;
}
printf("%d",sf);
}
Answer: D
The above code will result in an error because a macro cannot be defined using a simple assignment operator. In the code shown above, the value of sf is changed to 100 using the assignment operator. This causes an error.