C Program to Find Factorial Number

How to write a C Program to find the factorial of a number in C Programming Language ?

Solution of C Program: 

/*C Program to Find Factorial Number*/
#include<stdio.h>
void main()
{
int x, n, fact;
printf("\nEnter the value of n : ");
scanf("%d", &n);
x = 1;
fact = 1;
while(x <= n)
{
fact*=x;
x++;
}
printf("\nThe Factorial of a Number is : %d.", fact);
}


You may also learn these C Program/Code :

C Program To Swap Two Numbers Without Using Third Variable



Learn More :