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

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899603
Joined: Mon Aug 02, 2021 8:13 am

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

Post 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();
}
}
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply