Why is "i" variable getting incremented twice in my program?
I modified the question but why is the output different. shouldn't it be same?.?
Code :-
#include<stdio.h>
#define MAX(x,y) (x)>(y)?(x):(y)
void main(void)
{
int i = 10;
int j = 5;
int k = 0;
k == MAX(i++, ++j);
printf("%d %d %d",i,j,k);
}
Output :- 11 7 0
Shouldnt the output be 12 6 0