Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
// Java Coding Challenge - 08: Reversing a Number using String
//Title of this code //'main' method must be in a class 'Rextester'. //Compiler version 1.8.0_45 import java.util.*; import java.lang.*; class Rextester { public static void main(String args[]) { int number = 12345; String num = String.valueOf(number); String result = ""; for (int i = num.length() - 1; i >= 0; i--) { result = result + num.charAt(i); } int reverse = Integer.parseInt(result); System.out.println("Reverse: " + reverse); } }
run
|
edit
|
history
|
help
0
Main
Tree_inorder_recursive
Coding Numbers - Polindrome
First Unique Character in a String
ekse
3.E
1d
Using Recursion reverse the Line
1.6
Problem: rstring