I have to read endless averages of students and if they are greater than or equal to 7 the student is approved, if not, he is disapproved, and if I type -1 the program stops and issues a closing message. >
I'm trying hard to make this program and also wanted to add something that says when the user types something that is not between 0 and 10 (which are the possible student grades), but I'm not getting it.
printf("Digite a media final do aluno");
scanf("%d",&media);
if(media>=0 && media<=10)
while(media!=-1)
{
if(media>=7)
printf(" APROVADO! \n");
printf("Media do proximo aluno: \n");
scanf("%d",&media);
else {
printf(" REPROVADO! \n");
printf("Media do proximo aluno: \n");
scanf("%d",&media);}
}
printf("Fim do programa! \n"); // quando eu digito -1
else
printf("Voce digitou numero invalido ");
system("PAUSE");
return 0;