write a program to reverse a 3 digit number in java
Answers
Answered by
1
Answer:
public class Reverse
{
public static void main(String args[])
{
}
}
Explanation:
saanvi0001:
can u please give the whole program
Answered by
0
This program can also reverse numbers having more than 3 digits
import java.util.Scanner;
public class NumberReverser {
int reverse = 0;
public static void main(String [] args){
Scanner sc = new Scanner(System.in);
System.out.print("Enter a number: ");
StringBuilder number = new StringBuilder(sc.next());
System.out.print("The reversed number is ");
System.out.print(number.reverse());
}
}
Output:
Enter a number: 123456789
The reversed number is 987654321
Similar questions
Computer Science,
6 months ago
Math,
6 months ago
Science,
1 year ago
Environmental Sciences,
1 year ago