A Continue
statement jumps out of the current loop condition and jumps back to the starting
of the loop code.
Example
|
using System;
using System.Collections;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ConsoleApplication1
{
class Program
{
static void Main(string[] args)
{
int i;
for (i = 0; i <= 20; i++)
{
if (i == 10)
continue;
if (i == 20)
break;
Console.WriteLine("value is" + i);
}
Console.ReadLine();
}
}
}
|