Source Code
num=int(input("Enter a number : "))
n=num res=0
while num>0:
rem=num%10
res=rem+res*10
num=num//10
if res==n:
print("Number is Palindrome")
else:
print("Number is not Palindrome")
OUTPUT
Enter a number : 1221
Number is Palindrome
Source Code
num=int(input("Enter a number : "))
n=num res=0
while num>0:
rem=num%10
res=rem+res*10
num=num//10
if res==n:
print("Number is Palindrome")
else:
print("Number is not Palindrome")
OUTPUT
Enter a number : 1221
Number is Palindrome
Hello, my name is G Krishna. I'm Creating this blog for the students who are beginners.
Learn More →
No comments:
Post a Comment