Created
July 16, 2012 09:41
-
-
Save yesidays/3121847 to your computer and use it in GitHub Desktop.
Control básico de Alumno
This file contains hidden or 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
#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