You are using the post-decrement operator. This is because you are writing result-- but not --result. The value of the expression result-- is a copy of result, it is defined before the decrementing. That's why it's called post-decrement.
After the value of the expression result-- is defined, result is decremented. But: Right after this, the value of result is overriden by the value of the result-- expression (result = 5), which was 5.