8. C# - BREAK/CONTINUE JUMPS
Breaks:
break; // breaks loops
Continue:
continue; // skips any code after/below it if conditions are met.
Example:
for (int i = 0; i<5; i++)
{
Console.WriteLine(“i = {0}”, i); if (i == 2)
continue;
Console.WriteLine(“I will not be printed if i=2.\n”);
}
Comments
Post a Comment