Answers for "how to stop a while loop c#"

C#
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

C# Answers by Framework

Browse Popular Code Answers by Language