5.5 While

The while loop has the following syntax:

    while (condition)
        statement


It works this way: if the condition evaluates true the statement is executed, than the condition is checked again and the process repeats until the condition becomes false.

If the statements within the loop do not cause the condition to change you'll end up with an endless loop.

This, and other documents, can be downloaded from http://opencbp.sourceforge.net/.

For questions about the Open C Book Project, read the documentation.