Loop

There IS a semi-colon after do-while statement: do{}while();

do{

}while(1); //<- while( );

break; exit from the innermost loop / switch statement

continue; skip the remaining statements of current iteration, and continue the next step (conditional statement / iteration)

comma operator , evaluate all sub-exprs and return the value of the rightmost one

Hint: use relational expr (>, <) rather than equality expr to avoid infinite loop

DO NOT USE Float in loop

for (int i = 0; //  Initialization Statements
    i<100; // Exit Condition
    i++){

} // No semi-colon here

你可能感兴趣的:(Loop)