Revisions: 08/24/01, 12/12/04, 08/21/06
Chapter 24 — Arrays and Loops
This chapter discusses how arrays and
counting loops make a powerful combination.
In nearly all programs of appreciable size
this combination is used constantly.
- Counting loops and arrays.
- Filling in an array.
- Printing out an array.
- Array length as a variable.
- User input of array length.
Look at these two facts:
- An array is a collection of similar data,
numbered 1, 2, 3, ...
- A counting loop repeatedly executes its loop body,
while counting up 1, 2, 3, ...
Do you see how a loop might be used with an array?