• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 186
  • Last Modified:

ARRAY - urgent

Hi,

I have 2 d array.

How to find the largest and smallest value..

score[years][iterations]
0
Jasbir21
Asked:
Jasbir21
  • 2
1 Solution
 
CEHJCommented:
Something like

int max, min;
max = Integer.MIN_VALUE;
min = Integer.MAX_VALUE;
for(int i = 0;i < score.length;i++) {
      for(int j = 0;j < score[i].length;j++) {
            min = Math.min(min, score[i][j]);
            max = Math.max(max, score[i][j]);            
      }
 
}
0
 
Jasbir21Author Commented:
Thanks..
0
 
CEHJCommented:
:-)
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now