Tuesday, 26 September 2017

For loop with program | #23



Key Points :

 for loop :

                                * As for loop is entry control loop, first initilisation takes place & then the
                                condition is checked & at last the increment / decrement takes place.

                                * Initilisation,Condition,inc/dec written in the one line. So, LOC is decreased.
                                Because of this for loop is more used than other loops.
                               
                Syntax :
                               
                                for(initilisation ; Condition ; inc/dec)
                                {
                                                loop body;                                         
                                }

                # Note :
                                for loop executes only when the condition is true.
                                Loop will exicute repeately until the condition in the for statement become false.



No comments:

Post a Comment

Popular Posts :