previous | start | next

## The `do` Loop

- Sometimes you want to execute the body of a loop at least once and perform the loop test after the body was executed.
- The `do/while` loop serves that purpose.

  >     do
  >     {
  >        statements
  >     }
  >     while (condition);

- Example:

  >     do
  >     {
  >        xold = xnew;
  >        xnew = (xold + a / xold) / 2;
  >     }
  >     while (fabs(xnew - xold) > EPSILON);

previous | start | next