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();
}
}
Write a program that prints all digits of a positive integer in reverse order. import java.util.Scanner; public class Re
-
- Site Admin
- Posts: 899603
- Joined: Mon Aug 02, 2021 8:13 am