Question: 8 . 9 . 1 : Find 2 D array max and min. Write a loop to iterate from 0 to the last row of

8.9.1: Find 2D array max and min.
Write a loop to iterate from 0 to the last row of milesTracker. Within each row, use a nested loop to iterate from 0 to the last column of milesTracker.
Within the nested loop, if an element is greater than maxMiles, assign maxMiles with the value of the element. Similarly, if an element is less than minMiles, assign minMiles with the value of the element.
Ex: If the input is:
-10203040
the output is:
Min miles: -10
Max miles: 40

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!