Computer Science, asked by abysge, 8 months ago

pallendriome program in python

Answers

Answered by tyagicoolboy22
1

n=int(input("Enter number:"))

temp=n

rev=0

while(n>0):

dig=n%10

rev=rev*10+dig

n=n//10

if(temp==rev):

print("The number is a palindrome!")

else:

print("The number isn't a palindrome!")

Answered by anindyaadhikari13
2

Question:-

  • Write a program in python to check whether the entered number is palindrome or not.

Program:-

n=int(input("Enter a number: "))

x, s=n, 0

while n!=0:

s=s*10+n%10

n=n//10

if(s==x):

print("Number is palindrome. ")

else:

print("Number is not palindrome. ")

Similar questions