Created
November 20, 2022 07:17
-
-
Save codephilosopher/a8bb83220dfec3bdd74dba9aa57485d3 to your computer and use it in GitHub Desktop.
simple recursion
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import "fmt" | |
func main() { | |
SimpleRecursion(3) | |
} | |
func SimpleRecursion(n int) { | |
if n > 0 { | |
fmt.Println(n) | |
SimpleRecursion(n - 1) | |
} | |
return | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment