ramontricolor12

LISTA 04 - Exercício 01

Jul 8th, 2013
51
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.61 KB | None | 0 0
  1. /* CABEÇALHO
  2.    Arquivo: LISTA 04 - Exercicio 1.c
  3.    Objetivo: Exibir a media de um grupo de notas e as notas acima dessa media.
  4.    Autor(a): Ramon Borges
  5.  */
  6.  
  7. #include <stdio.h>
  8. #define MAX 10
  9. int main()
  10. {
  11.     float alunos[MAX], media = 0;
  12.     int i;
  13.     for(i = 0; i < MAX; i++)
  14.     {
  15.         printf("\nDigite um numero: ");
  16.         scanf("%f", &alunos[i]);
  17.         media += (alunos[i] / MAX);
  18.     }
  19.     printf("\nMEDIA = %.3f", media);
  20.     printf("\n***NOTAS ACIMA DA MEDIA***");
  21.     for(i = 0; i < 10; i++)
  22.         if(alunos[i] > media)
  23.             printf("\n%.2f", alunos[i]);
  24.  
  25.     return 0;
  26. }
Advertisement
Add Comment
Please, Sign In to add comment