C Programming Reference >> C Programming Reference Question Bank >>
19/07/07 - Views - Ratings :   2.69 of 5 / 16 Votes
Level - Beginner
Question -
What will be the output of the following code and why?
#include <stdio.h>
#define ASS Donkey
int main() { printf ("ASS");
return 0;
} |
Answer -
ASS
Explanation -
It is a kind of a deceptive question based on misguiding user based on loose concentration. Only thing here to observe is that ASS though defined as macro will be treated as a string if used in printf statement in double quotes. So code prints ASS instead of Donkey. This a very easy question to tackle if you observe carefully.
Reader Comments -
| Kulkarni
|
nice c questions and vinod,if u can post some good C questions u can post rather sit and pass useless comments
|
| akshay
|
hey wtf man!!!! aint u reacting as if all da guyz here are dumb stupid nd assholes!!!! bt lemme tell u... nt every1z like u k!!!!(no1z hving all these qualities of urs here!!) so get the fuck outta here and close this fucking blog!!!!
|
| akshay
|
hey wtf man!!!! aint u reacting as if all da guyz here are dumb stupid nd assholes!!!! bt lemme tell u... nt every1z like u k!!!!(no1z hving all these qualities of urs here!!) so get the fuck outta here and close this fucking blog!!!!
|
| Keshav Agrawal
|
Exactly akshay... this question is no deceptive... its plain and straightforward...
|
| alok pandey
|
exactly right kulkarni,vinod is useless........
|
| alok pandey
|
exactly right kulkarni,vinod is useless........
|
| geet
|
What a synonymous ques ;p
|
| nagesh
|
very gud question.............
|
|