September 1998
Intermediate to advanced
848 pages
20h 13m
English
This is the general form of the while loop:
while (expression)
statement
The statement part can be a simple statement with a terminating semicolon, or it can be a compound statement enclosed in braces.
The examples so far have used relational expressions for the expression part; that is, expression has been a comparison of values. More generally, you can use any expression. If expression is true (or, more generally, nonzero), the statement is executed once, and then the expression is tested again. This cycle of test and execution is repeated until expression becomes false (zero). Each cycle is called an iteration (see Figure 6.1).
Here is ...
Read now
Unlock full access