Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /* CABEÇALHO
- Arquivo: LISTA 03 - Exercicio 17.c
- Objetivo: Calcule a media aritmetica de 500 valores.
- Autor(a): Ramon Borges
- */
- #include <stdio.h>
- #define quantNum 10.0
- int main()
- {
- int i;
- float media = 0, valores;
- for(i = 1; i <= quantNum; i++)
- {
- printf("\nInforme o algarismo: ");
- scanf("%f", &valores);
- media += (valores / quantNum);
- }
- printf("\nMEDIA = %f\n", media);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment