Last active
March 8, 2018 05:27
-
-
Save parzibyte/36e1e1e995d38db14f672f977f883026 to your computer and use it in GitHub Desktop.
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
package main | |
import "fmt" | |
func main() { | |
numeros := [...] int {18, 28, 21, 96, 97} | |
numeroMayor := numeros[0] //Asignar variable al primer elemento | |
for _, numero := range numeros { | |
if numero > numeroMayor{ | |
numeroMayor = numero | |
} | |
} | |
fmt.Printf("El número mayor entre %v es %d", numeros, numeroMayor) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment