August 2012
Intermediate to advanced
976 pages
30h 17m
English
while StatementA while statement repeatedly executes a target statement as long as a condition is true. Its syntactic form is
while (condition) statement
In a while, statement (which is often a block) is executed as long as condition evaluates as true. condition may not be empty. If the first evaluation of condition yields false, statement is not executed.
The condition can be an expression or an initialized variable declaration (§ 5.2, p. 174). Ordinarily, the condition itself or the loop body must do something to change the value of the expression. Otherwise, the loop might never terminate.
Note
Variables defined in a while ...
Read now
Unlock full access