That's wrong!
Your program will print
13.
This is because you are printing
"a" not
"b".
Now, let suppose you wanted to know the result b, I assume.
First of all, it's not advised to use this kind of same pre/post incremented variables multiple times in an expression as it creates confusion as well as make it less readable.
However, let's look at why that's happening.
If you will check result of following-
b=++a + ++a
you will see b will print 24 instead of expected 23. That's because, at first execution it will considers 2 operand and take them for addition. Now as pre-increment has higher priority, a's value will be incremented to 7 (due to twice pre-increment). The addition operation now will add a twice , i.e, a + a which is equals to 24.
Now, consider the case, b=++a + ++a+ ++a.
First 2 operands will be taken out and added which gives 24 as result (as we saw above) and will be stored in a temporary variable. Then it will pick the 3rd operand which 13 now and will add to the value stored in temp variable.
so, i.e, 24+13=37.
Summary:
Note: Expression evaluation starts from right end.
b=++a + ++a+ ++a;
=> b = ++a + (++a + ++a)
=> b = ++a + (++a + (a=11))
=> b = ++a + (temp=((a=12) + a))
=> b = ++a + (temp=(12+12=24))
=> b = ++a + temp)
=> b = (a=13) + temp
=> b = 13 + 24
Hope, it clarifies the doubt.
Other members of the community, please let me know if I am wrong. Please use comment section instead of down voting ;)