A quote from an Algorithms textbook:
"When a for or while loop exits in the usual way (i.e., due to the test in the loop header), the test is executed one time more than the loop body."
So, for example, a for loop that begins with for j=1 to 3
will be executed not 3 times, but 4 times!
Question: Why would such a loop be executed 4 times and not 3 times?
By my reasoning:
When j = 1, the loop is executed.
When j = 2, the loop is executed.
When j = 3, the loop is executed.
When j = 4, the loop is NOT executed.
I count 3, not 4.