Q. What is the output?
Code:#include <stdio.h>
#define SQUARE(x) x*x
int main() {
printf("%d", SQUARE(3+1));
return 0;
}
β
Correct Answer: (C)
7
Explanation: SQUARE(3+1) expands to 3+1*3+1 = 3+3+1 = 7. Use parentheses in macro!