#include <stdio.h>
/*
variables
int
i = contador de la funcion while
nota = nota individual
total = Suma de todas las notas
float
promedio = Promedio total de todas las notas
*/
int main ()
{
int i = 1;
int nota;
int total = 0;
float promedio;
printf("Promedio obtenido en 5 notas\n");
do
{
printf("Ingrese nota #%d\n",i);
scanf("%d",¬a);
total += nota;
i++;
}
while (i < 6 );
promedio = (float) total/5;
if (promedio < 60 )
printf("MAL ALUMNO\n");
else if (promedio < 71)
printf("ALUMNO PROMEDIO\n");
else if (promedio < 86)
printf("BUEN ALUMNO\n");
else
printf("EXCELENTE ALUMNO\n");
return 0;
}
0 comentarios:
Publicar un comentario