Created
October 16, 2019 18:38
-
-
Save parzibyte/22c89f97e2164ff165a3b845f63b0a17 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() { | |
calificaciones := [10] int {78, 20, 55, 90, 99, 78, 96, 50, 80, 100}; | |
sumatoria := 0 //Aquí iremos sumando cada valor | |
/* | |
Recorrer el arreglo | |
*/ | |
for _, calificacion := range calificaciones{ | |
sumatoria += calificacion | |
} | |
//El promedio es dividir la sumatoria entre el número de calificaciones | |
promedio := sumatoria / len(calificaciones) | |
fmt.Println("El promedio es", promedio) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment