Can't understand why this output producing. Please explain with details.
The below code is giving me the desired output. Like
#include <stdio.h>
#define product(p,q) p*q
int main()
{
printf("%d",product(5,3));
return 0;
}
Output:
15
But the same logic and macro in the below code give me output like below.
#include <stdio.h>
#define product(p,q) p*q
int main()
{
int x=3,y=4;
printf("%d",product(x+2,y-1)); // x+2=5 and y-1=3
return 0;
}
Output:
10