import java.io.*;
public class rnum
{
public static void main(String[] arrs)
{
int a=0;
int mod=0;
int res = 0;
System.out.println("\nEnter the Enter the number...");
try
{
InputStreamReader isr = new InputStreamReader(System.in);
BufferedReader br = new BufferedReader(isr);
String s = br.readLine();
a = Integer.valueOf(s).intValue();
} catch(Exception e)
{
System.out.println(" Exception :"+e);
}
System.out.println("The original number :"+a);
while(a>0)
{
mod=a%10;
res=mod+(res*10);
a=a/10;
}
System.out.println("Reverse number :"+res);
}
}
Sunday, December 14, 2008
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment