+ 1
Why the below code is showing the value of x as 16 however it should be 1 similar to the y. Please help me.
#include <stdio.h> #define sqr(x) x*x int main() { int x = 16/sqr(4); int y = 16/16; printf("%d\n",sqr(4)); printf("x=%d\n",x); printf("y=%d\n",y); return 0; }
1 ответ
+ 1
x == 16/sqr(4) == 16/4*4 == 16.
y == 16/16 == 1.
z == 16/(sqr(4)) == 16/(4*4) == 1.