Whenever the program control finds the C# Continue statement, it skips the remaining statements in the code and set the pointer to the beginning of the loop for the next iteration.
Let us see the example C# code.
C# Continue statement Example
using System; public class Program { static void Main() { for (int i = 1; i <= 6; i++) { if (i <= 3) { continue; } Console.WriteLine(i); } Console.WriteLine("Control is out of loop"); Console.Read(); } }
OUTPUT
Difference between the C# break and continue statement
Break statement allows the control to come out of the loop from execution. Whereas the continue statement skips only the current iteration and continues with the next iteration in the C# loop.