Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
var
TheNameEntered : String;
TheNumberEntered : Integer;
ACounterToUse : Integer;
begin
Write( 'Enter your name: ' );
Readln( TheNameEntered );
Write( 'Enter a number between 1 and 20: ' );
Readln( TheNumberEntered );
If( ( TheNumberEntered < 1 ) Or ( TheNumberEntered > 20 ) ) Then
Begin
Writeln( 'The number is not between 1 and 20 ! Program stopped !' );
Exit;
End; { If Then }
{ start doing the stuff }
For ACounterToUse := 1 To TheNumberEntered Do
Begin
Writeln( 'Counter: ', ACounterToUse, ' Name: ', TheNameEntered );
End; { For Do }
Writeln( 'Program is done...' );
end.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment