Program to accept a number from the user and print the reverse of it





#program to accept a number from the user and print the reverse of it

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

c=0

while n>0:

    b=n%10

    c=c*10+b

    n=n//10


print("The reversed number is",c)



Comments

Popular Posts