/********** Program To Print Reverse Of A Number *******/

class Reverse
{
public static void main(String args[])
{
int i,s=0,a = 120;
int no[] = new int[10];
System.out.print("Original Number : "+a);
for(i=0;i<10;i++)
{
if(a!=0)
{
no[i] = a%10;
a = a / 10;
s++;
}
else
break;
}
System.out.print("\n\nReversed Number : ");
for(i=s;i>0;i--)
{
System.out.print(+ no[i] +" ");
}
}
}

/************ OUTPUT ************
* Original Number : 120

* Reversed Number : 0 1 2 */

2 comments:

  1. hey its sandy, here is the website i was talking about...... the website is here

     
  2. hey its sandy, here is the website i was talking about...... the website is here