ARRAY - urgent

Hi,

I have 2 d array.

How to find the largest and smallest value..

score[years][iterations]
Jasbir21Asked:
Who is Participating?
 
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
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.