import java.io.*;
class Reverse
{
public static
void main(String args[])throws Exception
{
int a, b=0, c,
i, r, j=1;
DataInputStream in = new DataInputStream(System.in);
System.out.println("Enter the number of digits");
c =
Integer.parseInt(in.readLine());
for(i=1;
i<c; i++)
{
j=j*10;
}
System.out.println("Enter the number");
a =
Integer.parseInt(in.readLine());
while(a!=0)
{
r = a%10;
b =(j*r)+b;
j=j/10;
a=a/10;
}
System.out.println("The reversed number is\n"+b+"");
}
}
