User enters a phrase and program outputs the same phrase in reverse
Delphi & Pascal (česká wiki)
Category: KMP (Club of young programmers)
Program: Reverse.pas
File exe: Reverse.exe
Program: Reverse.pas
File exe: Reverse.exe
User enters a phrase and program outputs the same phrase in reverse.
{ REVERSE.PAS } { User enters a phrase and program outputs the same phrase in reverse} { } { Author: Unknown } { Datum: 20.01.2009 http://www.trsek.com } program output_reverse_string; uses crt; var s : string; i : integer; begin clrscr; writeln ('PLease enter your name so it can be outputed in reverse order'); readln (s); writeln; for i := 1 to length(s) do begin end; writeln; for i := length(s) downto 1 do begin write(s[i]); end; readkey end.