I thought basic arithmetic operators had same precedence in most languages. But for the following code snippet-
int a = 5;
a = --a + a++;
//print a
C copiler (GNU GCC) gives me result as 9
where as in java I get 8
. What's going on?
According to me it should be 8 ( 4 + 4 )