Write a java program to find reverse of a given number(non static method)
Answers
Answered by
0
Answer:
Java program to reverse a number
1:- class ReverseNumber. { public static void main(String args[]) { int n, reverse = 0;
2:- System. out. println("Enter an integer to reverse"); Scanner in = new Scanner(System. in); n = in. nextInt();
3:- while(n != 0) { reverse = reverse * 10; reverse = reverse + n%10; n = n/10; }
Explanation:
hope this help you
plz mark me as brainlist plz plz
Similar questions