First of all, I would like to apologize, if this question has been asked before in this forum. I searched, but could't find any similar problem.
I am a beginner in C. I was going through a tutorial and came across a code, the solution of which I can't understand.
Here is the code -
#include <stdio.h>
#define PRODUCT(x) (x*x)
int main()
{
int i=3, j, k;
j = PRODUCT(i++);
k = PRODUCT(++i);
return 1;
}
I tried running the code through compiler and got the solution as "j = 12" and "k = 49".
I know how #define works. It replace every occurrence of PRODUCT(x) by (x*x), but what I can't grasp is how j and k got the values 12 and 49, respectively.
Any help would be appreciated.
Thank you for your time.