November 2002
Beginner to intermediate
142 pages
4h 19m
English
A loop
consists of a statement or block, called the loop body, that is
executed several times, depending on a given condition. C offers
three statements to construct loops: while,
do ... while, and
for.
In each of these loop statements, the number of loop iterations
performed is determined by a controlling
expression
. This is an expression of a
scalar type, i. e., an arithmetic expression or a pointer. The
expression is interpreted as “true”
if its value is not equal to 0; otherwise it is
considered “false”.
Syntactically, the loop body consists of one statement. If several statements are required, they are grouped in a block.
Read now
Unlock full access