There are many different forms of loops used in programs. The indefinite loop and the conditional termination loop have already been used and several more forms will be used throughout the book. One of the simplest and most useful is the counting loop. The counting loop allows a sequence of instructions to be executed a set number of times. The program in figure 7.1 is an example of this; it is a program to input and sum four numbers.
Weitere Kapitel dieses Buchs durch Wischen aufrufen
- Counting Loops
- Macmillan Education UK
ec4u, Neuer Inhalt/© ITandMEDIA