What is the output of this program?
#include <stdio.h>
#define clrscr() 17
int main()
{
clrscr();
printf("%d",clrscr());
return 0;
}
Answer: C
Correct answer: 17
clrscr() is a function-like macro expanding to the constant 17. The first call becomes the statement 17;, which computes a value and discards it - legal, if pointless. The printf then expands to printf("%d", 17) and prints 17.
Please log in or register to report this question.