Summary: The do while Statement

I l @ ve RuBoard

Summary: The do while Statement

Keywords

The keywords for the do while statement are do and while .

General Comments

The do while statement creates a loop that repeats until the test expression becomes false or zero. The do while statement is an exit-condition loop; the decision to go through one more pass of the loop is made after the loop has been traversed. Therefore, the loop must be executed at least once. The statement part of the form can be a simple statement or a compound statement.

Form

 do  statement  while (  expression  ); 

The statement portion is repeated until the expression becomes false or zero.

Example

 do     scanf("%d", &number) while(number != 20); 
I l @ ve RuBoard


C++ Primer Plus
C Primer Plus (5th Edition)
ISBN: 0672326965
EAN: 2147483647
Year: 2000
Pages: 314
Authors: Stephen Prata

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net