Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- int main()
- {
- int i,quantity,counter = 0;
- float grades[100],sum = 0;
- printf("Entre com a quantidade de notas a serem lidas :\n");
- scanf("%d",&quantity);
- for (i = 0; i < quantity; i++)
- {
- printf("Entre com a nota do aluno :\n");
- scanf("%f",&grades[i]);
- sum = sum + grades[i];
- }
- printf("Media das notas = %f\n",sum/quantity);
- printf("Notas superiores a media :\n");
- for (i = 0; i < quantity; i++)
- {
- if (grades[i] > sum/quantity)
- {
- printf("%f ",grades[i]);
- }
- }
- printf("\nNotas inferiores a media :\n");
- for (i = 0; i < quantity; i++)
- {
- if (grades[i] < sum/quantity)
- {
- printf("%f ",grades[i]);
- }
- if (grades[i] == sum/quantity)
- {
- counter++;
- }
- }
- printf("Quantidade de notas igaus a media : %d\n",counter);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment