iOS training------My C language notes, look forward to communicating with you!
#include <stdio.h>/*While (condition) {loop Body} operating principle 1. If the initial condition is not established, the loop body will never be executed 2. If the condition is established, the loop body is executed once, the execution is complete, and the condition is determined again ... break directly ends the entire while loop Continu E ends the current loop body and enters the next loop body execution*/intMain () {//1. First identify the actions that need to be performed repeatedly//2. Re-determination of constraints//defines the number of times a variable record is made intCount =0; /*while (count<10) {++count; if (count%2! = 0) {printf ("Do%d push-ups \ n", count); } }*/ //Output Display:Do the 1th push-ups do 3rd push-ups do 5th push-ups do 7th push-ups do 9th push-ups/*while (count<10) {++count; if (count%2 = = 0) {//directly end this cycle body, enter the next cycle continue; } printf ("Do%d push-ups \ n", count); }*/ //Output Display:Do the 1th push-ups do 3rd push-ups do 5th push-ups do 7th push-ups do 9th push-ups while(Count <Ten) { ++count; printf ("do the first%d push-ups \ n", Count); if(Count = =5) { Break; } } //Output Display:Do the 1th push-ups do 2nd push-ups do 3rd push-ups do 4th push-ups do 5th push-upsreturn 0;}
"Good Programmer's note sharing" C language while statement