The value just so happens to be 36 due to the order your compiler decided to evaluate the line.
Line 6 of your program has
undefined behavior. (which is bad)
The C++ standard does not dictate the order that functions are evaluated in a line of code, so you don't know what exactly will happen (operators ++ and -- count as functions, by the way).
Try running this code using
cpp.sh (the picture of the gear next to your code) -- the printed value is different than the one your compiler calculated.
For more information, look at the section called "Undefined Behavior" in
http://en.cppreference.com/w/cpp/language/eval_order
It probably explains it better than I can.
In general, don't mutate the same value more than once in the same line of code (in your case, you're changing the value of a twice).