According to the site link :
"First, the definition of PAR number can only be applied to integers, so a number is even if being divided by number two, the result is an integer. written in the form 2n ", with n belonging to the set of integers"
Thus 8 is even since 2 x 4 = 8.
One way to analyze this in programming is through the much-used MOD function or the remainder of the entire division. If the remainder of a number divided by two is zero (0) it will be even! Otherwise, if the remainder of the entire division by 2 is different! = From zero the number will be odd.
See the code below. I made small modifications, study the code and try to do it myself. Good Study
/*Calcula a media dos ímpares numa matriz que recebe números INTEIROS*/
#include <stdio.h>
#include <stdlib.h>
float mediaImpar(int a[4][4]); //protótipo da função
int main(int argc, char** argv) {
int numero, linha, coluna;
int matriz[4][4]; //declara uma matriz 4 x 4 com linhas e colunas 0,1,2 e 3
float media = 0.0;
for(linha = 0; linha < 4; linha++){
for(coluna = 0; coluna < 4; coluna++){
system("CLS"); //limpa a tela
printf("Entre com o elemento matriz[%d][%d]: ", linha+1, coluna+1);
scanf("%d", &matriz[linha][coluna]);
}//fim for
}//fim for
media = mediaImpar(matriz); //chama a função
printf("====A matriz digitada====\n\n");
for(linha = 0; linha < 4; linha++){
for (coluna = 0; coluna < 4; coluna++){
printf("%2d ", matriz[linha][coluna] );
if (coluna == 3)
printf ("\n");
} //fim for
} //fim for
printf("\nMedia dos números impares da matriz: %.2f",media);
return (EXIT_SUCCESS);
} //fim main
float mediaImpar(int a[4][4]){
int count = 0, i, j;
int soma = 0;
for(i = 0; i < 4; i++){
for(j = 0; j < 4; j++){
if(a[i][j] % 2 != 0){
soma += a[i][j]; // o mesmo que soma = soma + a[i][j];
count++;
}//fim if
}//fim for
}//fim for
float media = (float)soma/count; //cast para que o resultado da media seja float
return media;
} //fim mediaImpar
View the output of the program when it is run: