Answers for "c# exit for"

C#
2

c# exit for

Use "break;"
  
for (int i = 1; i <= 100; i++)
{
	if (i == 5)
	{
		break;
	}
}
Posted by: Guest on July-01-2020
4

c# stop loop

while (playerIsAlive) 
{ 
// this code will keep running
  if (playerIsAlive == false) 
  { 
    // eventually if this stopping condition is true, 
    // it will break out of the while loop
    break; 
   } 
 } 

// rest of the program will continue
Posted by: Guest on March-04-2020
-1

c# program exit

System.Windows.Forms.Application.ExitThread( )
Posted by: Guest on March-26-2020

C# Answers by Framework

Browse Popular Code Answers by Language