Java, .NET, PHP, PYTHON, ANGULAR, ML, Data Science, Testing, CI Tutorials in Easy Languages.

"Best Software Training, Internship, Project Development center of Indore India, Helpline 780506-3968"

Break and Continue Statement in C#:-

A break statement is used to terminate the loop manually using condition.

for(int i=1;i<=10;i++)
{
       if(i==3)
       break;
      Console.WriteLine(i);

}
o/p  1 2

Continue:-   It is used to skip the data based on condition, Loop will process after continuing statement.

for(int i=1;i<=10;i++)
{
       if(i==3)
       continue;
      Console.WriteLine(i);

}

o/p   1 2 4 5 6 7 8 9 10


Post a Comment

If you have any doubt in programming or join online classes then you can contact us by comment .

Previous Post Next Post