fork download
  1. #include <stdio.h>
  2.  
  3. int media(int vet[]) {
  4. int soma = 0;
  5. for (int i = 0; i < 5; i++) soma += vet[i];
  6. return soma / 5;
  7. }
  8.  
  9. int main() {
  10. int vet[5] = {4, 2, 1, 6, 7};
  11. printf("%d", media(vet));
  12. }
  13.  
  14. //https://pt.stackoverflow.com/q/445744/101
Success #stdin #stdout 0s 4556KB
stdin
Standard input is empty
stdout
4