Counter-Controlled Repetition with a while loop
#include <stdio.h>
main ()
{
int i = 1; initialization of loop
control variable
/* count from 1 to 10 */
while ( i < 11 ) test condition that terminate loop
{
printf (“%d “, i);
i++; modification of loop control
} variable
}
Previous slide
Next slide
Back to first slide
View graphic version