Why doesn’t the code below print 16 ,0?
#define SUM 1+3
int main(void) {
printf("%d %d\n", SUM*SUM, 4-SUM);
return 0;
}
>Solution :
Because c treats that like x+y, not the result of that addition.
(if you want it to treat it like the result, simply put parentheses before and after the expression)
#define SUM (1+3)
int main() {
printf("%d %d\n", SUM*SUM, 4-SUM);
return 0;
}