+ 1
What is the output of this code.
#define sqr(i) i*i main() { printf"%d", sqr(3+1)); } How the output become 7. Please explain it....
1 Answer
+ 15
David
Macro is used to substitute the values in above code snippet so when sqr() function is called then argument inside the function is substitute by defined macro here value of i is replaced by i*i and the value of i=3+1 so it will do like
3+1*3+1=>3+3+1=7
So output become 7