Last active
December 17, 2015 15:18
-
-
Save ahoulgrave/5630306 to your computer and use it in GitHub Desktop.
Algoritmo para calcular promedios hasta que se ingresa -1
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
ALGORITMO calcularPromedios | |
var | |
int: | |
cantidadNumeros, numero, suma | |
float: | |
promedio | |
Inicio | |
cantidadNumeros = 0 | |
suma = 0 | |
promedio = 0 | |
LEER numero | |
MIENTRAS numero <> -1 ENTONCES | |
suma = suma+numero | |
cantidadNumeros = cantidadNumeros+1 | |
LEER numero | |
FIN_MIENTRAS | |
SI cantidadNumeros > 0 ENTONCES | |
promedio = suma/cantidadNumeros | |
Escribir "Promedio: ";promedio | |
SINO | |
Escribir "No se ingresaron numeros" | |
FIN_SI | |
Fin |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment