Created
January 15, 2018 14:33
-
-
Save lucianoschillagi/39bce4121cfdc6d715de7b62a555d5e0 to your computer and use it in GitHub Desktop.
Pasa valores a través de funciones
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
func teLosDoy() { | |
necesitoDosNumerosParaMultiplicar(n1: 4, n2: 7) // pasa los argumentos a la func 'necesitoDosNumerosParaMultiplicar' | |
} | |
func necesitoDosNumerosParaMultiplicar(n1: Float, n2: Float) { | |
let resultado = n1 * n2 | |
imprimoElResultado(queEs: "\(resultado)") // pasa los argumentos a la func 'imprimoElResultado' | |
} | |
func imprimoElResultado(queEs: String) { | |
print("El resultado es \(queEs)") | |
} | |
teLosDoy() // prints 'El resultado es 28.0' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment