The result of the program is undefined by Standards, the expression suffers from an issue called "sequence point" which happens when the variable is accessed and modified more than once in an expression.
Whatever result you get is compiler specific. Search net for more information on "sequence point".
~ swim ~
I checked that code on that linked post when I answered there but I was not sure after seeing there your and another previous replies. So I just mentioned in java and added about c++ later so just relate to c++.....
Here I just added link for alternative explanations.. I have only one that.
I thought to add more, but stopped after seeing your reply.. Not answered more..
I thought to delete also, because you added enough explanation...
All fine now..?
this way output is 1 1 3
but when we write in this way
printf("%d %d %d",a,a++,++a);
OUTPUT 3 2 3
this way lead to" sequence point" problem as mansioned before