+ 7
Completely agreed with Ipang the increment decrement problem is compiler dependent various compiler convert or read the increment in sequence in different order like
(++b, b), b++
(++b), (b, b++)
And other options as applicable according to the compiler and execute that
+ 5
It is not possible to "judge" which compiler is correct or not, the output of typical code where a variable value is accessed and modified multiple times (like your code) is compiler dependent, it is not a wonder why you get different output on different compiler, as commonly termed - undefined behaviour.
Tips: Avoid accessing and modifying a variable's value multiple times in a sequence point.
+ 3
when multiple operation is carried out in a single variable something happen which is known as sequence point, which brings about undefined behavior, which I think Ipang have explained vividly
0
I think a similar problem with different increment results was discussed here in great detail:
"Can you explain the output!"
https://www.sololearn.com/discuss/1800527/?ref=app



