take console input in pascal
Taking Console Input in Pascal
To take console input in Pascal, you can use the readln
procedure to read input from the console. Here's an example of how you can use it:
program ConsoleInputExample;
var
userInput: string;
begin
writeln('Enter your input: ');
readln(userInput);
writeln('You entered: ', userInput);
end.
In this example, the readln
procedure is used to read a line of text from the console and store it in the userInput
variable. The entered input is then displayed back to the user using the writeln
procedure.
Note: The readln
procedure is used to read input from the console in Pascal.
[[SOURCE 1]]