To contents Next section

3.2.1 while

While is the simplest of the loop control structures. It looks just like an if statement without the else part:
while ( expression )
    statement;
The difference in how it works isn't that big either, the statement is executed if the expression is true. Then the expression is evaluated again, and if it is true the statement is executed again. Then it evaluates the expression again and so forth... Here is an example of how it could be used:
int e=1;
while(e<5)
{
    show_record(e);
    e=e+1;
}
This would call show_record with the values 1, 2, 3 and 4.

To contents Next section