Questions from a beginner:
How can I find the sum and average value of elements of a multidimension array?
How can I find the largest element in a column?
How can I find the max difference between adjacent arrays?
I started to write a function as below
void average(float matrix[ROWS][COLS], int r, int c)
{
int i, j;
float sum; average;
sum = 0;
for( i = 0; i < ROWS; i++)
{ for ( j = 0; j < COLs; j++)
sum += matrix[j]
What is incorrect in above?
Advice would be highly appreciated
How can I find the sum and average value of elements of a multidimension array?
How can I find the largest element in a column?
How can I find the max difference between adjacent arrays?
I started to write a function as below
void average(float matrix[ROWS][COLS], int r, int c)
{
int i, j;
float sum; average;
sum = 0;
for( i = 0; i < ROWS; i++)
{ for ( j = 0; j < COLs; j++)
sum += matrix[j]
What is incorrect in above?
Advice would be highly appreciated