12, distinguish three cycles, the cycle of death

12.1 three loop differences

Three kinds of differences cycle:

  1. If the conditional never been satisfied, then the for loop and while loop will be executed zero times, but do-while loop will execute at least once.

  Variable 2.for circulating in parentheses among definition, only the inner loop can be used. while loop and do-

while initialization statements already outside, so came out cycle can continue to use.

 

Can be nested between cycles

 

12.2 infinite loop

Never not stop the cycle, called an infinite loop

Guess you like

Origin www.cnblogs.com/koss/p/12283409.html