For loop

This is an example of a typical for loop.

for( int var=0; var<10; var++) {
    // Code to execute    
}

The initiation of the for loop includes three different command seperated be semicolons.

First
In this example an integer named var is created and initialized to  ;
If we are using a variable that has already being instantiated just enter the name of the variable and optionally assign it a new value.
ie.

int var = 0;
for(var=2; var<10; var++) {
    // Code to execute    
}

Second
This is where we provide the loops condition. The code in the loops body will continue to repeat as long as this condition remains true. In our example the loop will execute as long as the variable var contains a value less than 10.

Third
This code executes after each iteration of the loop. In our example the variable var is incremented by one after each iteration.