Skip to content

Instantly share code, notes, and snippets.

@isagallerani
Created May 28, 2016 02:51
Show Gist options
  • Save isagallerani/5669f434cf48919225dc752db47b80f8 to your computer and use it in GitHub Desktop.
Save isagallerani/5669f434cf48919225dc752db47b80f8 to your computer and use it in GitHub Desktop.
#include <stdio.h>
#include <stdlib.h>
int main () {
int nota[5], rep = 0, rec = 0, a = 0, b = 0, i;
for (i = 0; i < 5; i++) {
printf ("Digite a nota: ");
scanf ("%d", &nota[i]);
}
for (i = 0; i < 5; i++) {
if (nota[i] < 5) {
rep++;
}
else if (nota[i] >= 5 && nota[i] < 6) {
rec++;
}
else if (nota[i] >= 6 && nota[i] < 8) {
b++;
}
else if (nota[i] >= 8) {
a++;
}
}
printf ("Numero de alunos reprovados: %d\n", rep);
printf ("Numero de alunos em rec: %d\n", rec);
printf ("Numero de alunos conceito B: %d\n", b);
printf ("Numero de alunos conceito A: %d\n", a);
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment