I have searched all over the internet and tried many different things but i cant seem to get this right. I'm trying to get this program to find the smallest number in this multidimensional array. I did that. Now I am trying to get it to find the sum of the row and column that contain the smallest number. I am having trouble with this. I can only get it to print out the sum of each row and column but I don't want that. I just want the row and column of the smallest. This is the code that finds the sum of each row and column as opposed to only the one that I want. Do you have any advice or hints? thanks in advance
1 2 3 4 5 6 7 8 9
int totalrow = 0;
for (int i = 0; i<r; i++)
{
for (int j = 0; j<c; j++)
totalrow = totalrow + cool[i][j];
cout << "total of row " << i << " is " << totalrow << endl;
totalrow = 0;
}
int totalrow = 0; // Needs to be initialized before the loop. Not in the loop
for (int col = 0; col<C; col++) // Changed c to upper case to indicate # columns constant
{ totalrow += cool[low_row][col];
}
cout << "total of row " << low_row << " is " << totalrow << endl;