0

Why the output of second sqr(3+1) is 7?

#define sqr(i) i*i int main() { printf("%d %d ",sqr(3),sqr(3+1)); }

2nd Dec 2019, 9:35 AM
Code
Code - avatar
2 ответов
+ 2
Note sqr() is i*i, not (i)*(i) sqr(3) -> 3*3 sqr(3+1) -> 3+1*3+1 -> 3+3+1 -> 7
2nd Dec 2019, 9:42 AM
你知道規則,我也是
你知道規則,我也是 - avatar
0
Thank you👍
2nd Dec 2019, 9:46 AM
Code
Code - avatar