nikolas_serafini

Lista 4 - Exercício 1

Jun 19th, 2013
44
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.47 KB | None | 0 0
  1. #include <stdio.h>
  2.  
  3. int main()
  4. {
  5.     int i;
  6.     float sum = 0,grades[10];
  7.  
  8.     for (i = 0; i < 10; i++)
  9.     {
  10.         printf("Entre com a nota :\n");
  11.         scanf("%f",&grades[i]);
  12.         sum = sum + grades[i];
  13.     }
  14.  
  15.     printf("Media das notas : %.3f\n",sum/10);
  16.     printf("Notas superiores a media :\n");
  17.     for (i = 0; i < 10; i++)
  18.     {
  19.         if (grades[i] > sum/10)
  20.         {
  21.             printf("%.3f\n",grades[i]);
  22.         }
  23.     }
  24.     return 0;
  25. }
Advertisement
Add Comment
Please, Sign In to add comment