August 2012
Intermediate to advanced
976 pages
30h 17m
English
do while StatementA do while statement is like a while but the condition is tested after the statement body completes. Regardless of the value of the condition, we execute the loop at least once. The syntactic form is as follows:
do statementwhile (condition);
Note
A do while ends with a semicolon after the parenthesized condition.
In a do, statement is executed before condition is evaluated. condition cannot be empty. If condition evaluates as false, then the loop terminates; otherwise, the loop is repeated. Variables used in condition must be defined outside the body of the do while statement.
We can write a program that ...
Read now
Unlock full access