Python Program to Reverse a Given Number | python program to reverse a number using while loop


Python  Program to Reverse a Given Number

Python  Program to Reverse a Given Number | python program to reverse a number using while loop
Reverse number programe



Program 

n=int(input("enter number:"))
rev=0
while(n>0):
    dig=n%10
    rev=rev*10+dig
    n=n//10
print("reverse of the number:",rev)



Output -

 
enter number:123
reverse of the number: 321

Post a Comment

Post a Comment (0)

Previous Post Next Post