+5  A: 

You should have trouble predicting it, because it is in fact unpredictable. This is what's known as undefined behavior. Modifying a value more than once in an expression is legal, but undefined.

PigBen
Modifying a value more than once in an expression is not always undefined behavior, for example take the expression `(i++, i++)`. What is undefined behavior is modifying a value more than once *without an intervening sequence point* (or modifying a value and obtaining the modified value without an intervening sequence point).
FredOverflow
+2  A: 

The line

b = (++a) + (a++) + (a++);

invokes undefined behavior because you're attempting to modify the value of a more than once between sequence points. Any result is considered "correct".

John Bode
A: 

Should be 7. I read it as increment a by 1, then add a to a, then increment a, then add a, then increment a. This comes out 2 + 2 + 3 = 7.

David Watson
But the answer is coming out to be 6 that's why I am confused
Chetan Sharma
@David Watson: The result may as well be 42 or make the computer explode. The behavior is undefined because the same variable is modified twice inside one sequence point.
DarkDust