ramontricolor12

LISTA 03 - Exercício 17

Jun 28th, 2013
43
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.46 KB | None | 0 0
  1. /* CABEÇALHO
  2.    Arquivo: LISTA 03 - Exercicio 17.c
  3.    Objetivo: Calcule a media aritmetica de 500 valores.
  4.    Autor(a): Ramon Borges
  5.  */
  6.  
  7. #include <stdio.h>
  8. #define quantNum 10.0
  9.  
  10. int main()
  11. {
  12.     int i;
  13.     float media = 0, valores;
  14.  
  15.     for(i = 1; i <= quantNum; i++)
  16.     {
  17.         printf("\nInforme o algarismo: ");
  18.         scanf("%f", &valores);
  19.         media += (valores / quantNum);
  20.     }
  21.     printf("\nMEDIA = %f\n", media);
  22.     return 0;
  23. }
Advertisement
Add Comment
Please, Sign In to add comment