Loop in C #: while do ... while for

Loop: repeat the same or similar code is repeatedly executed at regular

Reduce code redundancy maintainable extensible

while(bool)

{

  ...;

}

Code blocks can break or interrupt continue

break: break the whole cycle

continue: break the cycle of this time

 

do

{

...;

}while(bool)

To perform a code block, then the next cycle is determined whether or not

 

for(int i=0;i<Length;i++)

{

  ...;

}

 

Guess you like

Origin www.cnblogs.com/1016391912pm/p/11601245.html