Another Example
Another Example: (Assume that n has been declared and assigned a value before the following program segment is to be executed.)
// Print the factors of integer n
// Invariant: the factors of n that are less than
// i have been printed, and 1 <= i <= n+1
Reminder: x % y yields the remainder when x is divided by y.