Friday 16 November 2012

For Loop:

The statements in the for loop repeat continuously for a specific number of times. The while and do-while loops repeat until a certain condition is met. The for loop repeats until a specific count is met. Use a for loop when the number of repetition is know, or can be supplied by the user.  The coding format is:

for(startExpression; conditionalExpression; increment/decrements)
{
    block of code;
}

Flow Diagram:


No comments:

Post a Comment