I need to create a program that builds an array and returns me the average of its numbers.
I already have the array built but I can not average the values.
The code I already have:
#include<stdio.h>
#include<stdlib.h>
int main(void){
int matriz [3][3] ={{0}}, i, j;
for(i=0;i<3;i++){
for(j=0;j<3;j++){
printf("introduza numeros para a matriz nos lugares [%d][%d] \n", i+1, j+1);
scanf("%d", &matriz[i][j]);
}
}
printf("\n\t");
printf("estes sao os valores da matriz\n\n");
printf("\t\t matriz ordenada");
for(i=0; i<3; i++){
printf("\n");
for(j=0;j<3;j++){
printf("%6d", matriz[i][j]);
}
}
printf("\n");
}