reverse number in java
public class ReverseNumber {
public static void main(String[] args) {
int num = 1234, reversed = 0;
while(num != 0) {
int digit = num % 10;
reversed = reversed * 10 + digit;
num = num / 10;
}
System.out.println("Reversed Number: " + reversed);
}}
Also in Java:
- set view layout params android
- how to show the hex detail of a file in java
- java convert a string to char[]
- query java persistence
- connecting to h2 database from java
- java program to display characters from a to z using loop
- eclipse does not support logback with spring boot
- java split string on two or more spaces except for words in quotes
- java 8 random string generator
- how to add a number to an array in java
- get raondom from array java
- javafx textarea font size
- dates in java 8
- how to create an abstract class in java
- online money transfer andhra bank
- compare strings in java
- how to create an array list in java
- java stack push
- java integer to binary string with leading zeros
- java string to integer
- how to iterate hashmap in java
- nullpointer extension
- processing string to int
- method overloading