I'm going over a practice exam right now and I've come across something I can't figure out. I understand what incrementing is but I just don't know why the answer is 0.
//What is the value of a after the following code is run (int a=12).
a += a -= a *= a;
I understand that a += a is 24 which is not my problem. When I run a cout after each incrament i get each a value equal to 24,0,0. How does a get from 24 to zero? Thats what im confused about.
Is it becuase its 12 + 12 = 24 - 24 = 0 * 0 = 0?