This question was asked to me in a mock interview...Really got surprised to find awkward answers...

consider a macro:

#define SQR(x) (x*x)

Example 1:

SQR(2) //prints 4

Example 2:

If SQR(1+1) is given it doesn't sum (1+1) to 2 but rather ...

SQR(1+1) //prints 3

Awkward right? What is the reason? How does this code work?

NOTE: I searched SO but couldn't find any relevant questions. If there are any kindly please share it!

Edit
Report