previous | index | next

The do...while Statement

The do...while statement is like a while statement that makes its test at the bottom of the loop. It has the form:

      do statement while (test);
where test evaluates to a boolean value and statement is repeated as long as test's value is true.

Where a while statement might not execute its body at all, a do...while statement always executes its body at least once:


previous | index | next