- #1
- 109
- 0
Homework Statement
one teacher wants to know the % of fail and aproved of the class of "N" number of students, the minimun qualification to aprove is "7", write a program that reads the students qualifications, and then the program says the number of aproved and failed students and the % of failed and aproved students.
Homework Equations
the code is in spanish my natal languaje but i am puting the translations of the code..
alumnos=students
reprobados=failed
aprobados=aproved
calification=qualification or the average sum of examns
indice=% of failed and aproved students
The Attempt at a Solution
its almost done but the program don't show the "how much students failed the curse"
here is my code
C:
#include<stdio.h>
int main(){
int x,a[5],ia,ir,repro=0,apro=0;
for(x=0;x<5;x++){
printf("ingrese la calificacion del alumno %d:\n",x+1);
scanf("%d",&a[x]);
}
for(x=0;x<5;x++){
if(a[x]>7){
apro++;}
}
for(x=6;x>0;x--){
if(a[x]<7){
repro--;}
}
printf("\n\nLos alumnos aprobados son %d\n",apro);
printf("\n\nLos alumnos reprobados son %d\n",repro);
ia=(2*apro)*10;
printf("\n\nEl indice de alumnos aprobados es del %d %%\n",ia);
ir=100-ia;
printf("\n\nEl indice de alumnos reprobados es del %d %%\n",ir);
return 0; }
Last edited by a moderator: