0
Why it show output is 28 please explain any one
#include <stdio.h> #define square(x) x*x int main() { int i=(28/square(4)); printf("%d",i); return 0; }
2 Respuestas
+ 7
Just for saftey, when declaring macros use parenthesis around the variables and around the whole thing if it helps:
#define square(x) x*x
/* to */
#define square(x) ((x)*(x))
a bit excessive, but it turns:
int i = 28/4*4;
/* into */
int i = 28/((4)*(4));
+ 6
square() is a marco, not a function, so
28/square(4) = 28/4*4 = 6*4 = 24.