i have been working on this for hours, and I can't figure out what im doing wrong. This is my first c++ class and i have struggled every step of the way. Im tired of trying this program for 5 hours straight. Help PLZ
the progrm finds and dispays maxium value in a two diminsional arry of integers. 4 by 5 array
then we have to modify it to show the subscript value
Here is what I have managed to come up with.
It doesn't show my arrays, the maximum value, and the maximum subscripts are wrong. Im pulling out my hair!
CODE
#include <iostream>
#include <iomanip>
using namespace std;
int main ()
{
const int firstrow = 4;
const int seccol = 5;
int data [firstrow][seccol] = {16, 22, 99, 4 ,18, -258, 4, 101, 5, 98, 105, 6, 15, 2, 45, 33, 88, 72, 16, 3};
int bigF = 0;
int bigS = 0;
int row, col;
for (row = 0; row < firstrow; row++)
{
for (col = 0; col < seccol; col++)
if (data[row][col] > data [bigF][bigS])
cout<< setw(4) << data[row][col];
}
{
bigF = row;
bigS = col;
}
cout << " Maximum value Row Subscript value: " << bigF <<endl;
cout << " Maximum value Column Subscript value: " <<bigS << endl;
cout << setw(5) << data[firstrow] [seccol];
return 0;
}