What is the output of the program, break and continue and for loop - C Statement

C examples for Statement:for

Description

What is the output of the program, break and continue and for loop

Demo Code

#include <stdio.h>
int main()/*ww  w . j a  v a2  s . c o m*/
{
   int x=0;
   for(;;)
   {
      x++;
      if(x<=5)
      {
         printf("%d, ",x);
         continue;
      }
      printf("%d is greater than 5!\n",x);
      break;
   }
   return(0);
}

Result


Related Tutorials