Title: Check whether the given number is
palindrome or not
Reverse number = Given number
232 is a Palindrome number
Program:
n=int(input("Enter n value\n"))
r=0
t=n
while(t>0):
r=(r*10)+(t%10)
t=t//10
if(n==r):
print(n,' is palindrome')
else:
print(n,' is not palindrome')
Output:
Enter n value
232
232 is palindrome
Comments
Post a Comment