Skip to content

Instantly share code, notes, and snippets.

@parzibyte
Created July 18, 2019 18:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save parzibyte/efcf37f490a786ff1193aa62047c1c43 to your computer and use it in GitHub Desktop.
Save parzibyte/efcf37f490a786ff1193aa62047c1c43 to your computer and use it in GitHub Desktop.
Factorial en Kotlin https://parzibyte.me/blog
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