Python Program to Print Given Number in Reverse Order

Python Program to Print Given Number in Reverse Order


 num=int(input("Enter any number:"))

tem=num

reverse_number=0

while tem>0:

    rem=tem%10

    reverse_number=(reverse_number*10)+rem

    tem=tem//10

print(f"The reverse of {num} is:",reverse_number)

print("End of Program")


Output:

Enter any number:123456

The reverse of 123456 is: 654321

End of Program

टिप्पणी पोस्ट करा

0 टिप्पण्या