In the final value was to have the total of the notes greater than 7, another condition would be that the user has to enter a number between 0 and 10, then any number outside this would give "invalid message", and would have its decrement, so for example if the user types: 11, 9 and 8; instead of appearing in total 3 notes > 7, it would only appear 2 ... But I can not do it, so if anyone knows how to solve it, or another way to do it, talk there coments ... Thank you in advance. >
#include <stdio.h>
int main () {
int aluno, i, alunosComNotaMaiorQueSete = 0;
float nota;
printf("Quantos alunos fizeram a prova? ");
scanf("%d", &aluno);
for(i = 0; i < aluno; i++) {
printf("Digite a nota do aluno %d:\n", i);
scanf("%f", ¬a);
if (nota<0 || nota>10)
{
printf("\n Nota Invalida\n");
alunosComNotaMaiorQueSete--;
}else if(nota>7 && nota<=10)
{
alunosComNotaMaiorQueSete++;
}
}
printf("Alunos com nota > 7: %d\n", alunosComNotaMaiorQueSete);
return 0;
}