previous | start | next

## The `for` Loop

- The most common loop has the form

  >     i = start;
  >     while (i <= end)
  >     {
  >        . . .
  >        i++;
  >     }

- Because this loop is so common, there is a special form for it.

  >     for(i = start; i <= end; i++)

- Example

  >     int product = 1;
  >     for (int i = 1; i <= n; i++)
  >        product = product * i;

previous | start | next