C Program for FUNCTION OF FIND THE FACTORIAL
float factorial(float);
void main()
{
float i=0,c=0;
clrscr();
printf("ENTER THE DIGIT TO FIND THE FACTORIAL: ");
flushall();
scanf("%f",&i);
c=factorial(i);
printf("THE FACTORIAL OF %f IS %f",i,c);
getch();
}
float factorial(float i)
float j=0,k=1;
for(j=1;j<=i;j++)
k=k*j;
return(k);
OUTPUT :
ENTER THE DIGIT TO FIND THE FACTORIAL : 5
THE FACTORIAL OF 5 IS 120.000