Skip to content

Instantly share code, notes, and snippets.

@isagallerani
Created May 28, 2016 03:36
Show Gist options
  • Save isagallerani/67ded20f0aad056cb9ef8fa78816f604 to your computer and use it in GitHub Desktop.
Save isagallerani/67ded20f0aad056cb9ef8fa78816f604 to your computer and use it in GitHub Desktop.
#include <stdio.h>
int main ()
{
double nota[5];
int rep=0,rec=0,B=0,A=0,i=0;
do
{
//printf ("i inicial %d\n",i);
printf("Digite uma nota entre 0 e 10: ");
scanf("%lf",&nota[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) && (nota[i]<=10))
{
A++;
}
}
}
}
i++;
} while ((nota[i-1] < 11) && (i < 5));
printf("O numero de alunos reprovados eh: %d\n",rep);
printf("O numero de alunos em recuperacao eh: %d\n",rec);
printf("O numero de alunos aprovados com conceito B eh: %d\n",B);
printf("O numero de alunos aprovados com conceito A eh : %d\n",A);
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment