while  for

Chapter 1: Overview

do

The do statement executes the associated statements, then tests an expression. If the value of the expression is true (non-zero), it returns to the beginning of the loop and executes the associated statements again. It continues in this pattern until the value of the expression is false (zero).

do
{
   do these commands;
}
while (expression);

NoteWhen using a while loop, the loop commands may not be executed at all; however, using a do ... while loop guarantees that the loop commands are executed at least once.





Copyright © 2005. Sybase Inc. All rights reserved. for

View this book as PDF