Skip to content

Commit 5f522f1

Browse files
authored
Create mmzmz.c
1 parent 88f1a28 commit 5f522f1

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

mmzmz.c

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
#include <stdio.h>
2+
void main()
3+
{
4+
int i, fact = 1, num;
5+
6+
printf("Enter the number \n");
7+
scanf("%d", &num);
8+
if (num <= 0)
9+
fact = 1;
10+
else
11+
{
12+
for (i = 1; i <= num; i++)
13+
{
14+
fact = fact * i;
15+
}
16+
}
17+
printf("Factorial of %d = %5d\n", num, fact);
18+
}

0 commit comments

Comments
 (0)