Oops!
i think you don't know exacly what *= work! because you did it for max! and max defined without any first value, so you will have an error here! then listen what you should do.
first, lets get values from user.
for that you should have 2 loops (also its better to have for loop). you should wrote loops to have on int to count the rows and one for count col.
the code will have look like this:
1 2 3
|
for(int i = 0; i < rows ; i++)
for(int j = 0 ; j < col ; j ++)
cin>>arr[i][j];
|
after we should have a function that found max.
so if you don't know about functions, you can find them in this site, read about functions and then wrote a function with parameters that you want, then in the function use loops same as i wrote it for you But now we should have and if statement and we don't need cin. so easiest way is have one int var... named max and with value of 0, then in if check if arr[i][j] > max then max = arr[i][j].
I hope you get your answer!.
ATTENTION : if your teacher force you to do this homework , its because he/she want, you learn something so, please start learning your lessons carefully.
Have Nice Life