Page 1 of 1

Write a program that prints all digits of a positive integer in reverse order. import java.util.Scanner; public class Re

Posted: Fri May 20, 2022 2:28 pm
by answerhappygod
Write a program that prints all digits of a positive integer in
reverse order.
import java.util.Scanner;
public class ReverseDigits
{
public static void main(String[] args)
{
Scanner in = new Scanner(System.in);
int n = in.nextInt();
// TODO: Print the digits of n in
reverse

while (/* Your code goes here */)
{
/* Your code goes here */
System.out.print(digit);
/* Your code goes here */
}

System.out.println();
}
}