Answers for "skip for loop c#"

C#
2

c# skip following code in loop

int bats = 10;

for (int i = 0; i <= 10; i++)
{
  if (i < 9)
  {  
    continue;
  }
  // this will be skipped until i is no longer less than 9
  Console.WriteLine(i);
}
// this prints 9 and 10
Posted by: Guest on March-04-2020
0

skip item in c# for loop

for (int i = 0; i < 10; i++) 
{
  if (i == 4) 
  {
    continue;
  }
  Console.WriteLine(i);
}  //the number 4 won't be written on the screen output
Posted by: Guest on November-18-2021

C# Answers by Framework

Browse Popular Code Answers by Language