One of the things
computers are often used for is the automation of repetitive tasks.
Repeating identical or similar tasks without making errors is something
that computers do well and people do poorly. This is also important for
animated cartoons. For example you may want your cartoon character to
wink 3 times in a row.
We have seen a program that uses recursion to perform repetition using
This type of repetition is called iteration, and C++ provides several
language features that make it easier to write iterative programs.
The two features we are going to look at are the
statement and the