Revised: 10/03/98, 08/05/99, 01/20/00, 02/19/04, 01/14/06, 10/12/08

The examples in this chapter show how counting loops and if statements are combined.

- Adding up even and odd integers
- Computing N factorial
- Dropping a brick
- Making a rectangle of stars

These examples give you practice in building programs out of fundamental pieces.

With only paper and pencil, would you like to add up all the integers from one to one thousand?