Apparently turbo C does this (we agree on that i equals 2 when it gets to your y=... expression):
1. it increments i by one, it will be 3
2. it increments i by one again, ii will be 4
4. it multiplies 3 and 4 and gets 12
5. it increments i by one again, it will be 5
6. it multiplies 12 by 5 and gets to the result: 60
So basically it breaks the expression
++i * ++i * ++i
down to something like this:
++i;
y = i;
++i;
y = y * i;
++i;
y = y * i;
The MS compiler on the other hand does this:
1. it increments i by one 3 times, since it "sees" three ++i statements, it will be 5
2. multiplies 5 by 5, gets 25
3. multiplies 25 by 5 and gets to the result: 125
So this would be something like:
++i;
++i;
++i;
y = i * i * i;
It is all a question of execution order. As far as i know, there is no standard that declares the order in such a situation, thus, both compilers are correct, they just interpret the expression differently. This is why if you want to write easily portable code, you should try to avoid such situations.