#include <stdio.h>
#define PRODUCT(x) (x*x)
int main()
{
int i =3,j,k;
j = PRODUCT(i++);
k = PRODUCT(++i);
printf("\n%d %d", j,k);
return (0);
}
-----------------------------------------------------------
The output is 9 and 49
shouldn't the answer be 12 and 20?
What are the steps the compiler takes to reach the above given output?
#define PRODUCT(x) (x*x)
int main()
{
int i =3,j,k;
j = PRODUCT(i++);
k = PRODUCT(++i);
printf("\n%d %d", j,k);
return (0);
}
-----------------------------------------------------------
The output is 9 and 49
shouldn't the answer be 12 and 20?
What are the steps the compiler takes to reach the above given output?
Comment