Answers for "C# continue"

C#
5

C# continue

class ContinueTest
{
    static void Main()
    {
        for (int i = 1; i <= 10; i++)
        {
            if (i < 9)
            {
                continue;
            }
            Console.WriteLine(i);
        }

        // Keep the console open in debug mode.
        Console.WriteLine("Press any key to exit.");
        Console.ReadKey();
    }
}
/*
Output:
9
10
*/
Posted by: Guest on July-11-2020
0

c# for loop next iteration

for (int i = 0; i < 10; i++){
 if(condition == true){
 	continue; //Next for loop interation
 }
 // Otherwise
 doStuff();
}
Posted by: Guest on November-08-2020

C# Answers by Framework

Browse Popular Code Answers by Language