Reverse a Number In Python
In this post, we learn how to reverse a number using a while loop in python
Program
Output
Program
Output
Algorithm To Reverse A Numberstep1: Start
step2: Accept a number i.e num
step3: Sum = 0
step4: reminder = num%10 sum = sum*10+reminder
num = num/10
step5: if num>0
step6: Display reverse number
Flow chart for a Reverse number
Summary
Hope this post is beneficial for you. I hope it added value to your knowledge of python programming.
0 Comments