|
| |
while
repeat a statement while an expression is true:
- while ( <expression> )
- {
- <statement>
- }
<statement> is repeated while the result of <expression> is non zero (true)
Notes:
- <statement> may be a compound;
- if <expression> is zero at start, <statement> is not executed;
- <statement> must include means of changing the value of expression or other
means of escaping the loop;
- beware of infinite loop;
Example: |
|
|