Author | Message |
---|---|
cgome106
Posts: 19
|
Posted 22:50 Dec 01, 2016 |
when we display outputs such as "Highest value at row x", should x be the index of that row, or the length value of the row? |
kknaur
Posts: 540
|
Posted 07:08 Dec 02, 2016 |
x is the index because you want to identify which row specifically has the highest value. |
ifiguer
Posts: 27
|
Posted 12:59 Dec 03, 2016 |
For reference. Use the index to check the element of the array in the row and use an if statement to compare the two elements. You can use a variable set to 0 to compare the first element then assign the element to the variable if it is higher, and continue through the row in the same way. int high = 0; if (arr[i] > high) { high = arr[i];} |