Skip to main content
To Get All Information of Sarkari Jobs | Results | Admit Card | And courses ,Internships then CLICK HERE

Continue Statement-:


continue is a keyword.The continue statement can only be use within loop.On execution it transfers the control to the beginning of the loop,Thus ignoring the execution of all other statement written below it within the loop.A continue statement should always be dependent upon the condition.
Syntax of continue statement in for loop-:
for( _ ; _ ;_ )
    {     _
           _
       if(condition)
            continue;
       else
              _
              _
      }
Example of continue statement in for loop -:
ads #include<stdio.h>
#include<conio.h>
main()
{ int i=1;
   for(i=1;i<=5;i++)
 { if(i==3)
    continue;
     else
     printf(" %d \n ",i);
  }
     getch();
  }
    Output-:  1
                     2
                     4
                     5
Syntax of continue statement in while loop-:
while(condition)
    {     _
           _
       if(condition)
          continue;
       else
              _
              _
      }
Example of continue statement in while loop -:
#include<stdio.h>
#include<conio.h>
main()
{ int i=1;
   while(i<=5)
{ if(i==3)
   continue;
   else
   printf(" %d \n ",i);
   i++;
 }
 getch();
  }
    Output-:  1
                     2
                     4
                     5
Syntax of continue statement in do-while loop-:
main()
{initialize;
  do
    {     _
           _
       if(condition)
           continue;
       else
              _
              _
      }while(condition);
}
ads

Example of continue statement in do-while loop -:
#include<stdio.h>
#include<conio.h>
main()
{ int i=1;
   do
{ if(i==3)
   continue;
   else
   printf(" %d \n ",i);
   i++;
 }while(i<=5);
   getch();
  }
    Output-:  1
                     2
                     4
                     5
Watch The Video Below

Comments

Post a Comment

Please do not enter any spam link in the comment box.


Download The Book "Let Us C" By Yashavant P.Kanetkar,Click The Below Button

-->Email Subscription

Enter Your Email Address:-

Delivered by FeedBurner

Copyright © 2020 TechProgramiz|All Right Reserved|Made By-: Sudarshan Pandey