write a program that take a 3-digit number thought the keyboard and reverse of that number (Ex: Input 168; Output -861
Answers
Answered by
4
import java.util.Scanner;
public class ReverseNumber {
public static void main(String[ ] args) {
System.out.print("Enter a number - ");
int number = new Scanner(System.in).nextInt( );
System.out.println("Reversed number - " + new StringBuffer(number + "").reverse( ).toString( ));
}
}
Similar questions