Skip to content

Commit 62fce1d

Browse files
authored
Update main.c
1 parent 53c77d6 commit 62fce1d

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

main.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,15 @@
11
#include <stdio.h>
22

3+
int factorial(int n) {
4+
if (n == 0) return 1;
5+
return n * factorial(n - 1);
6+
}
7+
38
int main() {
49
printf("Hello, GitHub Actions!\n");
10+
11+
int num = 5;
12+
printf("Factorial of %d is %d\n", num, factorial(num));
13+
514
return 0;
615
}

0 commit comments

Comments
 (0)