C Program to find Factorial of a given number
#include<stdio.h>
#include<math.h>
void main()
{
int n,i,f=1;
printf("\n enter the value of n
\n");
scanf("%d",&n);
for(i=1;i<=n;i++)
{
f=f*i;
}
printf("\n factorial = %d",f);
}
Output:-
enter the value of n
5
factorial = 120
0 Comments
Tell us your queries or more topics which you want