for loop
A for loop executes statements a predetermined number of times. The control expression for the loop is initialized, tested and manipulated entirely within the for loop parentheses.It is easy to debug the looping behaviour of the structure as it is independent of the activity inside the loop.
for ( initialize; control; increment or decrement)
{
// statement block
}
for(counter=2;counter <=9;counter++)
{
//statements block will be executed 10 times
}
Watch this video:
Comments