2.4 while

A while loop is a pre-checking loop. This means a condition is evaluated before an iteration is performed. The general form of a while statement is as follows:

'while' '('<bexpr>')' <stmt>

<bexpr> is also called a precondition. <stmt> executes if and only if <bexpr<> evaluates to true. However, after <stmt> executes, <bexpr> is evaluated again to see if another iteration is necessary.



Copyright © 2006-09-25 by Tak Auyeung