Dear All I have the following code and it works, just trying to understand the results.
OUTPUT OF CODE:
Sum = 0 i = 2
Sum = 4 i = 4
So why, on the first go around of the "for" statement, is "sum" not equal to 2?
MY ANSWER TO QUESTION
If the third part of the "for" statement(; i += i, sum = i) is being ignored in the first iteration of the loop, the results I see make sense?
FURTHER EVIDENCE FOR MY ANSWER
This also makes sense, because the first part of the "for" statement is being ignored after the first iteration of the "for" loop, otherwise "sum" and "i" would be set back to there original values.
Am I correct in my assumptions?