//C program to find Factorial of a Number Using Function
#include<stdio.h>
int factorial(int num)
{ int i = 1, fact = 1;
do
{
fact=fact*i;
i++;
} while(i<=num);
return (fact);
}
void main()
{
int n;
printf("Enter a number: ");
scanf("%d",&n);
printf("Factorial of %d is: %d",n,factorial(n));
}
Factorial of a Number In C Using Function
Algorithm
Program
Output
need an explanation for this answer? contact us directly to get an explanation for this answer