Skip to content

Commit f66e2bd

Browse files
Factorial number
program to find factorial of a number
1 parent 6be80a8 commit f66e2bd

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

Factorial number

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#include <stdio.h>
2+
3+
int main()
4+
{
5+
int c,n,f=1;
6+
7+
printf("Enter a number to calculate its factorial\n");
8+
scanf("%d", &n);
9+
for (c=1; c<=n; c++)
10+
f=f*c;
11+
12+
printf("Factorial of %d = %d\n", n, f);
13+
14+
return 0;
15+
}

0 commit comments

Comments
 (0)