Q:

Please explain "a-=(a--)-(--a)"

Can anyone please help me with this output-
a-=(a--)-(--a)

when the initial value of a is 6.
The answer upon execution is coming to 4 but according to me it should be -4. I would appreciate it if you could show me step-by-step. 

A:

a = 6
a -= (a--) - (--a)

Equivalent to:
a = a - ((a--) - (--a))

Right side is evaluated first, left to right:
       a1 -> a--2 -> --a3 -> (a--)-(--a)4 -> a-((a--)-(--a))
5

Step 1: a evaluates to 6.
Step 2: a--; evaluates to 6, a becomes 5.
Step 3: --a; evaluates to 4, a becomes 4.
Step 4: 6 - 4; evaluates to 2.
Step 5: 6 - (6 - 4) evaluates to 2.
Final: a = 6 - (6 - 4); a becomes 4.

