Flowchart to display the reverse of a number in python


flowchart to display the reverse of a number in python

B) To develop a flowchart to display the reverse of a number.

Purpose:

To find the opposite of the given number.


Algorithm:
Step 1: Start
Step2: Declare the variable n and read n.
Step3: R R R with 0.
Step4: Perform the following steps in the loop until the condition n = 0 is false.
d = n% 10
R = r * 10 + d
N = floor (n / 10)
Step 5: Print reverse number r if the condition is correct.
Step 6: End

FlowChart:

flowchart to display the inverse of a number in python
inverse of number

Input:

Enter the number:123

Output:

reverse number is   321

—- Run complete.  23 symbols evaluated.—

flowchart to display the reverse of a number in python

in this we have to find the reverse
of the given number
example : number = 12345 then output is
number_2 = 54321

Source Code:

x = int ( input ( ” enter the number : ” ) )
r = reverse ( x )
print (” Number : ” , x )
print (” Reverse : “ , r )

Python Related link

Reverse of a number

Have any Question or Comment?

Leave a Reply

Your email address will not be published. Required fields are marked *

Domain & free Hosting

Categories

You have successfully subscribed to myprogrammingschool

There was an error while trying to send your request. Please try again.

My Programming School will use the information you provide on this form to be in touch with you and to provide updates and marketing.