Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public void showMinMax()
- {
- int min = _arr[0];
- int max = _arr[0];
- for (int i=1; i<_arr.length; i++)
- {
- if (_arr[i] < min)
- min = _arr[i];
- else if (_arr[i] > max)
- max = _arr[i];
- }
- System.out.println (min + " " + max);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement