This article is a mirror article of machine translation, please click here to jump to the original article.

View: 18940|Reply: 0

[Source] C# What is the difference between break, continue, return in a while loop?

[Copy link]
Posted on 11/24/2017 5:14:35 PM | | |

break ends the loop, jumps out of the loop, and proceeds with the subsequent program;
continue to end this cycle and proceed to the next cycle;
return jumps out of the method where the loop is located, which is equivalent to ending the method.
How do I jump out of a two-layer while loop with break?
How do I use break to jump out of a two-layer loop?
bool BREAK=false;
while(...) {
  for(...) {
     if(...) {BREAK=true; break; }
  }
  if(BREAK) break;
}




Previous:New Radish Home Ghost Win10 x32 Selected Installed Edition 2017V09 (Perfect Activation)
Next:.net/c# to determine if the current time is on a business day
Disclaimer:
All software, programming materials or articles published by Code Farmer Network are only for learning and research purposes; The above content shall not be used for commercial or illegal purposes, otherwise, users shall bear all consequences. The information on this site comes from the Internet, and copyright disputes have nothing to do with this site. You must completely delete the above content from your computer within 24 hours of downloading. If you like the program, please support genuine software, purchase registration, and get better genuine services. If there is any infringement, please contact us by email.

Mail To:help@itsvse.com