Continue in C#


   Continue will skip execution of statements in the loop for once and continue the loop


Example Program for Continue in c#


using System;

 

//Program to print numbers 1 to 10 skipping number 4 using for loop

namespace ProgramCall

{

    class ContinueExample

    {

        static void Main()

        {

            //For loop to print numbers

            for (int num = 1; num <= 10; num++)

            {

                //if num is equal to 4 , don't print

                if (num == 4)

                    continue;

 

                //if num is 4 below statement will not be executed.

                //print the number on console.

                Console.WriteLine(num);

 

 

            }

 

            Console.ReadLine();

        }

    }

}



Output
1
2
3
5
6
7
8
9
10

In the above output, you can see the number 4 is not printed.



continue statement in c#, continue c#, c# continue, continue for c#, for continue c#, c# foreach continue, c# for loop continue, c# continue break ,break continue c#, c#.net break continue