#include <stdio.h>
#include <math.h>
#define n 160
double fatorial(int n) // n=j durante a andamento da função
{
double fat = 1.0;
int i;
for (i=1;i<=n;i++)
fat=fat*i;
return fat;
}
main()
{
int i,j;
double fat;
for (j=1;j<=n;j++)
{
fat=fatorial(j);
printf("%d %15.e \n",j,fat); // em vez de fat, poderia ser fatorial(j) e não atribuir à variável fat o valor de fatorial(j).
}
}
Comments