A counting while loop
(Display Listing 1.)
Normally I wouldn't use a while loop to implement a counting loop. Instead, I would use a for loop.
Since you already know about while loops and don't yet know about for loops:
I decided to begin with a while loop in order to be on familiar ground.
The source code for this program is presented in Listing 1.