+ 1
Why the answer is 3?
#define square(x)(x*x) int main() { int x, y=1; x=square(y+1); printf("%d",x); return 0; } O/P :- 3
3 Réponses
+ 2
A macro definition will substitute the source code directly (the text itself). Therefore, the statement
x = square(y + 1); is actually
x = y + 1 * y + 1;
so, x is y + y + y, and the result is 3
+ 2
Thank you, swim and Agent_1 , I got it. Thanks for help.