Advertisement
hmcristovao

Lista 04 - exerc 01

Jun 18th, 2013
328
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.46 KB | None | 0 0
  1. #include <stdio.h>
  2. #define MAX 10
  3. int main() {
  4.     int i;
  5.     float soma=0, notas[MAX], media;
  6.     for(i=0; i<MAX; i++) {
  7.         printf("Entre com a nota %d: ",i+1);
  8.         scanf("%f", &notas[i]);
  9.         soma += notas[i];
  10.     }
  11.     media = soma/MAX;
  12.     printf("\nMedia = %.2f", media);
  13.  
  14.     printf("\nNotas maiores do que a media:\n");
  15.     for(i=0; i<MAX; i++)
  16.        if(notas[i] > media)
  17.             printf("%.2f\n", notas[i]);
  18.  
  19.     return 0;
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement