Quantcast
Viewing all articles
Browse latest Browse all 2703

repeat until loop help

Im a beginner and i got a problem with repeat until loop
I want to know what exactly is supposed to happen in this little program :

program looptest;
Uses Crt;
Var YN : String;

Begin
Writeln('Y(YES) or N(NO)?');
Repeat {repeat the code for at least one time}
YN := Readkey ;
If YN = 'y' then Halt; {Halt - exit}
If YN = 'n' then Writeln('Why not? Exiting...');
Delay(1800); { wait a second plus 800 milliseconds }
Until (YN = 'y') OR (YN = 'n');
End.

thanks very much...

Viewing all articles
Browse latest Browse all 2703

Trending Articles