Break statement In C#

Break statement In C#

 

for (int i = 0; i < 20; i++) 
{
  if (i == 10) 
  {
    break;
  }
  Console.WriteLine(i);
}

 

int i = 0;
while (i < 20) 
{
  if (i == 10) 
  {
    i++;
    continue;
  }
  Console.WriteLine(i);
  i++;
}

2021-10-03