Possible Duplicate:
Could anyone explain these undefined behaviors (i = i++ + ++i , i = i++, etc…)
i tried this simple C program in GCC
#include<stdio.h>
int main(){
int x=5;
printf("%d,%d,%d,%d,%d",++x,x++,x,x++,++x);
return 0;
}
and the output was 9,7,7,6,6 i traced it and assumed that it will print 6,6,7,7,9 but i found my assumption in reverse order, how come!