Thursday 16 February 2017

For Loop

-The for loop is 3 actions.
(i)   Initialization Part :
(ii)  Test Conditional Part :
(iii) Increment Part :

-The Expression are separted by semi-Colons (;).

Syantax:

for( initialization expressions;test conditions;increment )
{
       Statement - 1;
       Statement - 2;
}



for loop Flowchart :























(i) The initialization sets a loop to an initial value.This statement is executed only once.

(ii) The test condition is a relational expression that determines the number of iterations desired or it determines when to exit from the loop.

(iii) The updations ( increment or decrement operations ) decides how to make changes in the loop.




No comments:

Post a Comment