Question: Questions: ( 3 0 points ) Write a function ReverseDigit that takes an integer as a parameter and returns the number with its digits reversed.

Questions:
(30 points) Write a function ReverseDigit that takes an integer as a parameter and returns the number with its digits reversed. Note that your output should exclude leading zeros in the reversed number (see the 2nd and the 4 th examples below) and keep the sign of the number intact, i.e. positive (and negative) numbers remain positive (and negative, respectively). Call the function from the main function to test it.
Sample input and corresponding output:
Enter an integer: 609
The number with the digits reversed is: 906
Enter an integer: 5600
The number with the digits reversed is: 65
Enter an integer: -1029
The number with the digits reversed is: -9201
 Questions: (30 points) Write a function ReverseDigit that takes an integer

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 Databases Questions!