Home   Easy-Code    Forum  Updater 
Twitter Facebook



Program to reverse a number using pascal

Critics Rating:

Users Rating:

(*PROGRAM TO REVERSE A NUMBER*)

program reverse;

uses crt;

var

i,n,s,r:integer;

begin

clrscr;

write("ENTER ANY NUMBER ");

read(n);

s:=0;

while (n>0) do

begin

r:=n mod 10;

n:=n div 10;

s:=s*10+r;

end;

writeln("THE REVERSED NO IS ",s);

end.

Courtesy, Source, References & Regards: Kishore AVGK

While using this site, you agree to have read and accepted our terms of use and privacy policy.
Copyright@2009-2011 by KuGuNi.com. All Rights Reserved.