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 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
Get step-by-step solutions from verified subject matter experts
