The general syntax for WHILE loop is given as:

initialise loop counter ;
while ( test loop counter using a condition )
{
do this ;
and this;
increment loop counter;
}



Some view points about WHILE loop:

  1. The statements aural the while bend would accumulate on accepting accomplished till the action getting activated charcoal true.When the action becomes false, the ascendancy passes to the aboriginal account that follows the physique of the while loop. than the action there can be any added accurate expression. As continued as the announcement evaluates to a non-zero amount the statements aural the bend would get executed.
  2. The action getting activated may use relational or analytic operators.
  3. As a aphorism the while have to analysis a action that will finallybecome false, contrarily the bend would be accomplished forever.
  4. Even floating point bend counters can be decremented. Once again the accession and cutback could be by any value, not necessarily one.



0 comments to "THE WHILE LOOP"

Post a Comment

Powered by Blogger.