Question: Write a program to reverse the digits of a positive integer number. For example, if the number 8 7 3 5 is entered, the number

Write a program to reverse the digits of a positive integer number. For example, if the number 8735 is entered, the number displayed should be 5378.(Hint: Use a do statement and continuously strip off and display the units digit of the number. If the variable num initially contains the number entered, the units digit is obtained as (num %10). After a units digit is displayed, dividing the number by 10 sets up the number for the next iteration. Thus, (8735%10) is5and (8735/10) is 873. The do statement should continue as long as the remaining number is not zero). using while loop

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!