For Loops

  1. The difference between the post-increment and pre-increment matters if you try to combine them into a larger expression.

    Post-increment (count++) will increase it's value after doing all of the other operations
    Pre-increment (++count) will increase it's value before doing all of the other operations

    Look at these two lines of code:
    a) result = count++ * 5;
    b) result = ++count * 5;

    If starting with count = 8:
    (a) will multiply 8 * 5, and store the 40 into result, then it will increase count to 9.
    (b) will first increase count to 9, then multiply 9 * 5 and store 45 into result