What will be the output of the following C code? [code]#define HELLO(a) #a main() { printf(HELLO(good morning)); }[/code]

What will be the output of the following C code?
Code:
#define HELLO(a) #a
main()
{
    printf(HELLO(good        morning)); 
}
A. good morning
B. goodmorning
C. good morning
D. error
 
Answer: c
Explanation: The output of the code shown above will be: good morning
In the resulting string, the consecutive blank spaces are replaced by a single blank space when we use the stringizing operator.
 

Tìm kiếm

Back
Top