Skip to content

Instantly share code, notes, and snippets.

@yesidays
Created July 16, 2012 09:41
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 yesidays/3121847 to your computer and use it in GitHub Desktop.
Save yesidays/3121847 to your computer and use it in GitHub Desktop.
Control básico de Alumno
#include <stdio.h>
int main() {
int calificaciones[50];
char nombre;
int total = 0;
int aprobadas, reprobadas;
int suma = 0, promedio = 0;
printf("Nombre del Alumno ");
scanf("%s", &nombre);
printf("¿Cuantas calificaciones? ");
scanf("%d", &total);
for (int i=0; i<total; i++) {
printf("Ingrese calificacion: ");
scanf("%d", &calificaciones[i]);
suma = suma + calificaciones[i];
if (calificaciones[i] > 5) {
aprobadas++;
} else {
reprobadas++;
}
}
promedio = suma / total;
printf("El promedio del Alumno es: %d \n", promedio);
printf("Total de Aprobadas: %d \n", aprobadas);
printf("Total de Reprobadas: %d \n", reprobadas);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment