c = (a++) + a is equivalent to the following:var t1 = a;a++;var t2 = a;c = t1 + t2;In which t1 is 1 and t2 is 2, which is leading to the result 3.And if you write the code like c = (++a) + a, it will be interpreted as the following:a++; // or more precisely, ++avar t1 = a;var t2 = a;c = t1 + t2;And you will get 4;