C++ Part 21

While and do-while Statements
A while STATEMENT WITH A SINGLE-STATEMENT BODY



while (Boolean_Expression)
Statement
A while STATEMENT WITH A MULTISTATEMENT BODY
while (Boolean_Expression)
{
Statement_1
Statement_2
.
.
.
Statement_Last
}
A do-while STATEMENT WITH A SINGLE-STATEMENT BODY
do
Statement
while (Boolean_Expression);
A do-while STATEMENT WITH
A MULTISTATEMENT BODY
do
{
Statement_1
Statement_2
.
.
.
Statement_Last
} while (Boolean_Expression);
Do not forget
the final
semicolon.  

Post a Comment

Popular Posts