FIT100
“Off By 1” Error
The most common error when working with iterations is to miscount by 1
•Everyone makes this mistake
•A common place where the “off by 1” error matters is in how many times a loop loops
•The importance of the WFI is it tells exactly
•
• for ( i=0; i<n;  i++) {
• <statement list>
•}
Number of iterations