#include <stdio.h>
#include <stdlib.h>
/*
*
*/
int main(int argc, char** argv) {
int i;
float notas[5];
int opcion;
int control = 1;
float listado;
float Media;
float Minima = 10;
float Maxima = 0;
while (control > 0) {
puts("Escoja una opción");
puts("0.Salir");
puts("1.Listar notas");
puts("2.Calcular media");
puts("3.Mínimo");
puts("4.Máximo");
puts("5.Introducir notas");
puts("Introduce una opción :\n");
scanf("%d", &opcion);
for (i = 0; i < 5; i++) {
if (opcion == 1) {
listado = printf("%f \n", notas[i]);
}
if (opcion == 2) {
Media = Media + notas[i];
}
if (opcion == 3) {
if (Minima > notas[i]) {
Minima = notas[i];
}
}
if (opcion == 4) {
if (Maxima < notas[i]) {
Maxima = notas[i];
}
}
if (opcion == 5) {
puts("Introduce las notas");
scanf("%f", ¬as[i]);
}
}
switch (opcion) {
case 1:
break;
case 2:
printf("La media de las notas es %f :\n", Media / 5);
break;
case 3:
printf("La nota mínima es %f: ", Minima);
break;
case 4:
printf("La nota máxima es %f:", Maxima);
case 5:
puts("Ha Introducido todas las notas");
break;
default: printf("Error\n");
}
}
return (EXIT_SUCCESS);
}
Comentarios recientes