Use int to control for loop - C Statement

C examples for Statement:for

Description

Use int to control for loop

Demo Code

#include <stdio.h>
int main()/*from www  .j a v  a2s  .c  o  m*/
{
   int i;
   for(i=0 ; i<5 ; i=i+1)
   {
      printf("Ouch! Please, stop!\n");
   }
   for(i=1 ; i<=10 ; i=i+1)
      printf("%d\t",i);
   return(0);
}

Result


Related Tutorials