Repeat ... Until looping almost similar with While...do ,The most important difference between the while-do loop and the repeat-until loop is that the code of the repeat statement is always executed at least once.
can perform more repetitions than one statement, either in the form of a collection of a single statement or a collection of block statement. so that repeated part is everything in between repeat.. Until statementSyntax :
repeat <statement1>; . . . <statementx>; until <expression>;or the syntax in baris
repeat
<statement1>;
. . . ;
. . . ;
<statementx>;
until <expression>;
the examples ;
repeat
k := i mode j;
i := j;
j := k;
until j = 0;
normally the looping will stop if expression value is False. but we can using break to force the program exit from looping and continuing the line below the loop
No comments:
Post a Comment