!Given a set of integers write a program to find those which are palindromes.
!For example ,the number 123321 is a palindrome as it reads the same
!from left to right and from rigfht to left
program palindrome
implicit none
integer::x,digit,rev_x,y
rev_x=0
print*,"Type the number"
read*,y
print*,"number is",y
x=y
do
if(x==0)then
exit
else
digit=mod(x,10)
x=x*0.1
rev_x=(rev_x+digit)*10
endif
enddo
rev_x=rev_x/10
print*,"The reverse of the typed number is=",rev_x
if(y==rev_x)then
PRINT*,"The number is a palindrome number"
else
print*,"The number is not a palindrome number"
endif
print*,y
end program palindrome
!For example ,the number 123321 is a palindrome as it reads the same
!from left to right and from rigfht to left
program palindrome
implicit none
integer::x,digit,rev_x,y
rev_x=0
print*,"Type the number"
read*,y
print*,"number is",y
x=y
do
if(x==0)then
exit
else
digit=mod(x,10)
x=x*0.1
rev_x=(rev_x+digit)*10
endif
enddo
rev_x=rev_x/10
print*,"The reverse of the typed number is=",rev_x
if(y==rev_x)then
PRINT*,"The number is a palindrome number"
else
print*,"The number is not a palindrome number"
endif
print*,y
end program palindrome