Sample Output:
package javaapplication1;
public class ReservedNumbers {
public static void main(String[] args) {
int n = 12345;
int t,r = 0;
System.out.println("The original numbers : " + n);
do
{
t = n % 10;
r = r * 10 + t;
n = n / 10;
}
while (n > 0);
System.out.println("The reversed numbers : " + r);
}
}
0 comments:
Post a Comment