print reverse of a number(using java)


// a=125  ans-521;

 class reverse

{

public static void main(String args[])

{

int  no=125, rev=0,b=0;

while(no>0)

{

b=n0%10;

no=no/10;

rev=rev *10+b;

}

System.out.println(rev);

}

}

Comments

Popular posts from this blog