Posts by user102859 • 136 points
1 post
-
2
votes2
answers6936
viewsA: Average C using vectors
The problem is in the mediaVetor declaration. Instead of int, uses float. As below: #include <stdio.h> float mediaVetor(float vet[], int tam){ float media, soma = 0; int i; for(i =0; i<tam;…