C language
-
Nested Loop
-
A loop body contains another loop statement
-
99 multiplication table of for statement
-
int a, b, c; for (a=1;a<=9; a++) { for (b = 1 ; b <= a ; b++) { c = a * b; printf("%d*%d=%d " , a, b, c); } printf("\n" ); }
-
-
Comparison of circular statements
- While and for judge first, then execute
2. Do while
3. While, do while and for can be usedBreak out of loop、Use continue to end this cycle、
- While and for judge first, then execute
-
Break and continue statements
-
break
-
Break statements cannot be used in places other than loop statements and switch statements
-
Break is used in switch to jump out of the switch loop instead of the loop
3. Break. You can only jump out of theThis layer of circulation、-
continue
- Continue can only be used in while, do while and for
-
int a; for ( a = 1; a <=100; a++) { If (a% 6 = = 0) // can be divided by six continue; printf("%d ", a); }
-
-
-
-
、