Archive

Archive for August, 2016

How To Reverse Number

August 6, 2016 Leave a comment

Below is code to reverse number.


public class ReverseNumber {

int reverse = 0;

public void reverse(int number) {
while (number != 0) {
reverse = reverse * 10 + number % 10;
number = number / 10;
}
System.out.println(reverse);
}
}

🙂

Categories: Java Tags: ,