
How to reverse two digits in javaprogramming?

package assignments;
public class DemoArray {
public void isReverse(int x) {
int temp = 0;
while (x > 0) {
temp = (temp*10) + (x % 10);
x = x / 10;
}
System.out.println(temp);
}
public static void main(String[] args) {
DemoArray d = new DemoArray();
d.isReverse(56);
}
}
If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.
Ask your questions, our development team will try to give answers to your questions.