Programming Pandit

c/c++/c#/Javav/Python


Latest Update

Monday, November 23, 2020

Python program to check a number is palindrome or not by G Krishna Chauhan

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

No comments:

Post a Comment