View Single Post
Old 09-27-2004, 01:21 AM   #3 (permalink)
frrossk
Registered User
 
frrossk's Avatar
 
Join Date: Sep 2004
Posts: 6
frrossk is on a distinguished road
Hello Uman

Try this:
Code:
#include <stdio.h>
#include <conio.h>

int main()
{
int num,e,x;
double work=1.0;
scanf("%d", &num);
for (x=1; x<=num; ++x)
{
work=work*x;
/*while (work>=10.0)
{
work=work/10.0;
++e;
}*/
}
printf ("%d factorial is %.3e\n",num,work);
getch ();
return 0;
}
To print a number in scientific format, you can use the "e" format argument.
frrossk is offline   Reply With Quote