Please note, this is a STATIC archive of website www.tutorialspoint.com from 11 May 2019, cach3.com does not collect or store any user information, there is no "phishing" involved.
Tutorialspoint

Compile and Execute Pascal Online

Program Reverse_num;
var n,rev:integer;
begin
    rev:=0;
    writeln('Input a number');
    readln(n);
    while n>0 do
        begin
            rev:=rev*10+(n mod 10);
            n:=n div 10
        end;
    writeln('The number in reverse order is ',rev);
end.

Advertisements
Loading...

We use cookies to provide and improve our services. By using our site, you consent to our Cookies Policy.