What is the output? #define SQ(x) x*x
What is the output?
#define SQ(x) x*x
printf("%d", SQ(3+1));
Show answerHide answer
Correct answer: (D) 7
Explanation
Expands to 3+1*3+1 = 7 (no brackets in the macro).
Correct answer: (D) 7
Explanation
Expands to 3+1*3+1 = 7 (no brackets in the macro).
This is question 131 of DSSSB TGT Computer Science Full Mock Test 2. See all questions of this paper with answers, or attempt the paper as a timed online test to get your score and all-India rank.