What will be the output of the following C code?
#include
#define INDIA 1
#define US 2
#define CC US
main()
{
#if CC==INDIA
printf("Rupee");
#elif CC==US
printf("Dollar");
#else
printf("Euro");
#endif
}
Answer: C
The output of the code shown above is Dollar. Since the macro CC is defined as US at the beginning of the code, it satisfies the condition #elif(CC==US). Hence “Dollar” is printed.