Commit 4442c03
authored
Create factorial.go
In this Go code, we define a recursive function called factorial that takes an integer n as input and returns the factorial of that number. The main function reads a number from the user and then calls the factorial function to calculate the factorial and prints the result.1 parent c848e11 commit 4442c03
1 file changed
+18
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
0 commit comments