N Nam Lê Member Sep 21, 2021 #1 What will be the output of the following C code? Code: #include<stdio.h> #define INDIA 1 #define US 2 #define CC US main() { #if CC==INDIA printf("Rupee"); #elif CC==US printf("Dollar"); #else printf("Euro"); #endif } A. Euro B. Rupee C. Dollar D. Error
What will be the output of the following C code? Code: #include<stdio.h> #define INDIA 1 #define US 2 #define CC US main() { #if CC==INDIA printf("Rupee"); #elif CC==US printf("Dollar"); #else printf("Euro"); #endif } A. Euro B. Rupee C. Dollar D. Error
Q Quốc Đặng Member Sep 21, 2021 #2 Answer: c Explanation: 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. Upvote 0 Downvote
Answer: c Explanation: 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.