I'm doing my homework and i need to do a program .i need to do a factorial n>12 and i do everything but i haven't solution.
My problem appear because I use unsigned long long and it's only have 32bytes. but 13! have more number than this . I need to use long double but i don't know how to use it .
#include <stdio.h>
#include <stdlib.h>
unsigned long long factorial(int x)
(13!>2^32-1)--> max 32 bytes
{int i=1;
int aux=1;
int p;
p= x+1;
while (i<p)
{
aux*=i;
i++;
}
x=aux;
};
int main()
{
float v1=0;
int e1=0;
while(e1<1 || e1>12)
{printf("Ingrese un valor: ");
scanf("%f",&v1);
e1=v1/1;/
if(e1!=v1)
printf("Solo se considera el numero entero: %d \n",e1);
if(e1>12)
printf("Este programa solo calcula hasta 12! (12 factorial) \n\n");}
printf("El factorial de %d es: %d \n",e1,factorial(e1));
printf("%d! = %d \n",e1,factorial(e1));
return 0;
}