!given an integer, write aprogram to reverse and print it.
program reverse_integer
implicit none
integer::n,digit,reverse_number
reverse_number=0
print*,"type the number"
read*,n
print*," number=",n
do
if(n==0)then
exit
else
digit=mod(n,10)
reverse_number=(digit+reverse_number)*10
n=n/10
endif
enddo
reverse_number=reverse_number/10
print*,"reverse_number=",reverse_number
end program reverse_integer
program reverse_integer
implicit none
integer::n,digit,reverse_number
reverse_number=0
print*,"type the number"
read*,n
print*," number=",n
do
if(n==0)then
exit
else
digit=mod(n,10)
reverse_number=(digit+reverse_number)*10
n=n/10
endif
enddo
reverse_number=reverse_number/10
print*,"reverse_number=",reverse_number
end program reverse_integer