Skip to content

Instantly share code, notes, and snippets.

@parzibyte
Last active March 8, 2018 05:27
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/36e1e1e995d38db14f672f977f883026 to your computer and use it in GitHub Desktop.
Save parzibyte/36e1e1e995d38db14f672f977f883026 to your computer and use it in GitHub Desktop.
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