Write a function to calculate the factorial value of any integer entered through the keyboard.

#include<stdio.h>
main()
{

int i, f;
int factorial();

printf("Enter the number to evaluate its factorial:");
scanf ("%d", &i);

f=factorial(i);

printf("%d! = %d\n", i, f);

}

factorial(int num)
{
int temp, fact;


for (temp=1,fact=1;temp<=num; temp++)
{

fact=fact*temp;
continue;
}
return (fact);



}






The file can be found at:
Download File

No comments:

Post a Comment

kiss on google ads if you are anonymous because your ip is trackable.thank you.

......from.admin