Set up a while loop to repeat a chunk of statements a given number of times. - C Statement

C examples for Statement:while

Description

Set up a while loop to repeat a chunk of statements a given number of times.

Demo Code

#include <stdio.h>
int main()//w  w  w  . j av  a2 s  . com
{
   int i;
   i=1;
   while(i<6)
   {
      printf("Ouch! Please stop!\n");
      i++;
   }
   return(0);
}

Result


Related Tutorials