C Plus Plus Loop

while
The while loop executes a statement over and over as long as the condition written in the while statement itself is ture. while( ) {   }

do-while
The function of the do-while loop is identical to that of the while loop, the only difference between them is in the syntax. do {   } while( )

for
The for statement has the following syntax: for ( ; ; ) The   expression is executed once before the loop, it usually defines the variable that will be used as a counter. For example: i=0 The  is a condition (statement) that will be evaluated each time. If the statement is true, the loop is repeated, else the loop stops, and the rest of the code is executed. The while-condition usually performs a logical operation to evaluate the value of the counter. An example of the while-condition is: i<10 The  is an expression that is executed each time before the  is evaluated. The expression usually increments a number to the counter, so that when the while-condition is evaluated, it will return false after a certain number of loop-repititions. An example on that is: i++

A full example on the code will be: for(i=0;i<10;i++) {   } The example above repeates the expression 10 times, because it: IF (i) is still less than 10, the loop is again repeated. ELSE the loop stops.
 * 1) sets i to 0
 * 2) increments 1 to i before each loop
 * 3) evaluates if i is still less than 10 before each loop