Reversing

Report a typo

Write a program that reads a three-digit number, calculates the new number by reversing its digits, and outputs a new number.

Tip: You can use the modulus operation to extract single digits from an integer.

Sample Input 1:

320

Sample Output 1:

23

Sample Input 2:

976

Sample Output 2:

679
Write a program in Java 17
import java.util.Scanner;

class Main {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
// put your code here
}
}
___

Create a free account to access the full topic