C Program Array NxM Elements Geometric/Arithmetic

How to Write a C Program for numbering the product of all real numbers listed in the array NxM elements,  or function counting the arithmetic average of all the numbers listed in the array NxM Elemental, for counting the geometric mean NxM array elements and for counting the arithmetic average above the main diagonal in the table NxM elements in C Programming Language ?


//Napisać procedurę liczącą iloczyn wszystkich liczb rzeczywistych znajdujących się w tablicy NxM elementowej.

Write procedure for numbering the product of all real numbers listed in the array NxM elements.



void iloczyn (int tablica[N][M])
{
 int i,j,iloczyn=0;
for(i=0;i<N;i++)
    for(j=0;j<M;j++)
       iloczyn*=tablica[i][j];
printf("Iloczyn liczb w tablicy wynosi: ",iloczyn);
}

//Napisać procedurę lub funkcję liczącą średnią arytmetyczną wszystkich liczb znajdujących się w tablicy NxM elementowej.

Write a procedure or function counting the arithmetic average of all the numbers listed in the array NxM Elemental



float srednia_aryt(int tablica[N][M])
{
int i,j,suma=0;
for(i=0;i<N;i++)
    for(j=0;j<M;j++)
       suma+=tablica[i][j];
return suma/N*M;
}

 //Napisać procedurę liczącą średnią geometryczną w tablicy NxM elementowej.

//Write procedure for counting the geometric mean NxM array elements.



float srednia_geo(int tablica[N][M])
{
int i,j,iloczyn=0;
for(i=0;i<N;i++)
    for(j=0;j<M;j++)
       iloczyn*=tablica[i][j];
return pow(iloczyn,NxM);
}

   //Napisać procedurę liczącą średnią arytmetyczną ponad główną przekątna w tablicy NxM elementowej.

Write procedure for counting the arithmetic average above the main diagonal in the table NxM elements.



float srednia_aryt(int tablica[N][M])
{
int i,j,suma=0;
for(i=0;i<N;i++)
    for(j=0;j<M;j++)
       if(i<j)
         suma+=tablica[i][j];
return suma/N*M;
}


Learn More :