Advertisement
Advertisement
//C# Continue statement example
using System;
class ContinueEx
{
public static void Main()
{
//The for loop to print digits from 5 to 9
for(int i=5;i<10;i++)
{
//If i==7 the associated continue statement is executed
if(i==7)
continue;
//Printin the value of i, if i is not equal to 7
Console.WriteLine("i = "+i);
}
Console.WriteLine("Out of the loop");
}
}
i = 5
i = 6
i = 8
i = 9
Out of the loop
Advertisement
Advertisement
Please check our latest addition
C#, PYTHON and DJANGO
Advertisement