Created
July 18, 2019 18:21
-
-
Save parzibyte/efcf37f490a786ff1193aa62047c1c43 to your computer and use it in GitHub Desktop.
Factorial en Kotlin https://parzibyte.me/blog
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
fun factorial(numero: Float): Float { | |
if (numero > 1){ | |
return numero * factorial(numero - 1) | |
} else { | |
return numero | |
} | |
} | |
println(factorial(5f)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment