#include "iostream.h"
#include "conio.h"
int main()
{
double n,m;
long i,j;
clrscr();
cout << "Please enter a number : ";
cin >> n;
cout << endl << "reverse number = ";
if (n<0)
{
n=-n;
cout << "-";
}
i=n;
m=n-i;
i=m;
j=0;
while (m-i>=0.00001)
{
m=m*10;
i=m;
if (i==0)
j++;
if (m-i>0.99999)
{
i++;
break;
}
}
if (i>0)
{
while (i>0)
{
cout << i%10;
i=i/10;
}
for (;j>0;j--)
cout << "0";
if (n>=1)
cout << ".";
}
else
{
i=n;
if (i==0)
cout << "0";
}
i=n;
while (i>0)
{
cout << i%10;
i=i/10;
}
cout << endl << "Press any key to continue.";
getch();
return 0;
}