I've had a good think about this and I REALLY can't see how you get the same result for both programs. Shabbir, the difference is that the second program has an extra a in it, so the first program adds 4 a's, and the second adds 5 a's, both with three post increments.
Actually I suspect it's down to something else like you haven't compiled the second program. OP, my suggestion is to modify the first program to:
Code:
cout<<"Test 1: "<<b<<a;
and the second to:
Code:
cout<<"Test 2: "<<b<<a;
Then post the exact results (use copy and paste if you don't want to type it in) and maybe I'll be able to guess how it got to the results. As the results for different order of evaluation don't have any overlap it can't be that you're using different compiler flags to affect the order of evaluation, so if you really are getting the same results then either you're doing something daft or you have a compiler bug (which is possible; clrscr and getch suggest you're using Turbo C 3.0, which seems very popular on this site for no obvious reason, and is very old and has numerous bugs, so the bottom line could be that you need a newer compiler).