Question: 4 Here is code to reverse a positive integer number, that is we input 123 and the computer will output 321. Please check whether this

 4 Here is code to reverse a positive integer number, that

4 Here is code to reverse a positive integer number, that is we input 123 and the computer will output 321. Please check whether this code is correct; if not, please correct it import java.util Scanner: public class ReverseNumber I Reverses the digits of an integer mathematically public static void main(Stringll args) int number, lastDigit, reverse 0; Scanner scan-new Scanner(System.in) System.out.prini"Enter a positive integer: ": a -scan nextint0 do reverse (reverse 10) + a b-b9610; a-a, 10; while (ac0); System.out printin"That mumber reversed is"+reverse): 6/9

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!