
















Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!

















or
do statement ; while ( logical expr is true ) ;
or, more commonly do { statement ; statement ; } while ( logical expression is true ) ;
do { printf ("enter a test score (0 to quit) >") ; scanf ("%d", &score) ; if (score >= 90) printf ("Your score of %d is a A\n", score) ; else if (score >= 80 && score <90) printf ("Your score of %d is a B\n", score) ; else if (score >= 70) printf ("Your score of %d is a C\n", score) ;
for ( expr1 ; expr2 ; expr3 ) { statement(s) ; }
for ( expr1 ; expr2 ; expr3 ) { statement(s) ; }
The Loop: expression1 ; while ( expression2 ) { statement ; expression3 ; }
Is Equivalent to:
for ( expr1 ; expr2 ; expr3 ) statement ;
int counter ;
counter = 1 ; while ( counter <= 10 ) { printf ("The counter value is: %2d\n", counter) ; counter++ ; }