{
double a ,b;
double factorial(double);
double result;
double n;
while (scanf("%lf",&n) == 1)
{
if (n > 10000.)
break;
else
{
result = factorial(n);
if( fmod(result,10.) != 0.)
{
a = fmod(result,10.);
printf("%5lf -> %lf\n",n,a);
}
else
{
do
{
b = result / 10.;
}while ( fmod(b ,10.) == 0.);
b = fmod(b ,10.);
printf("%5lf -> %lf\n",n,b);
}
}
}
system("PAUSE");
return 0;
}
double factorial(double n)
{
if(n == 0 )
return 1;
else
return factorial(n-1) * n;
}
that is my code...
but when i input number above 26...
it cannot work..(even below 26..maybe)
can anyone help me..
it seems has a big trouble
