I am taking a online c++ programing class. Since its online i have no
real instructer to help me understand the course. Our finals are due
friday and one of the programing problems on it has got me stuck. I
would really appreciate it if some one on here would be willing to help
me by either giving me pointers in the right direction or making the
program for me its not that its hard i just dont have the materials
needed to help me figure it out.
heres the problem
Create a program which will generate a 5x5 matrix of random generated
numbers using a muti dimensional array. Your values should range from 1
to 100. You will need to display the array to the screen, then the
program will display the max value for each row and the max value for
the array.
I can already get a array with randomly generated numbers but as for
geting the max for each row and the max value i cant figure out. please
im not trying to throw my work off on some one else this is just one of
many problems on our final. thanks in advance.

programing help
Eric Eichler
N_John
Denis Pitcher
Davids Learning
Finding the max is really easy just iterate through each element in your row, something like this:
int max = 0; //set to small value at first
it (matrix[row][col] > max)//repeat for each column in the row
max = matrix[row][col];
Martin Thwaites
#include <cstdlib> //for rand() and srand()
#include <ctime> //for clock() and time()
#include <iostream> //for cin,cout,endl
static const int conROWS = 5;
static const int conCOLS = conROWS;
int main(int argc, char* argv[])
{
int matrix[conROWS][conCOLS];
int maxvalue;
int r,c;
srand(clock() + time()); //seed the random number generator
//fill matrix with random values in range 1..100
for(r=0; r<conROWS; r++)
{
for(c=0; c<conCOLS; c++)
{
matrix[r]
std::cout << matrix[r]
};
std::cout << std::endl;
};
//work out max row element
for(r=0; r<conROWS; r++)
{
maxvalue= 0;
for(c=0; c<conCOLS; c++)
{
if(matrix[r]
maxvalue = matrix[r]
};
std::cout << "Max value in row " << r << " is " << maxvalue;
};
//todo workout max value overall and display it
return 0;
};
AnnNeedsHelp
0012FEA8 0012FEA8 0012FEA8 0012FEA8 0012FEA8
0012FED0 0012FED0 0012FED0 0012FED0 0012FED0
0012FEF8 0012FEF8 0012FEF8 0012FEF8 0012FEF8
0012FF20 0012FF20 0012FF20 0012FF20 0012FF20
0012FF48 0012FF48 0012FF48 0012FF48 0012FF48
Max value in row 0 is 76Max value in row 1 is 91Max value in row 2 is 98Max valu
e in row 3 is 91Max value in row 4 is 98Press any key to continue . . .
why are the numbers showing up like that
JGMiller
DanielN305517
Im not sure why they are showing like that, its in hex, it shouldnt be.
Can you paste the code you ran so i can check it