Thers an alternate way to do this would be to store all those numbers into an array, then sort the array and gets the first and last element(It uses java.util package):
arr_nums // integer array of 100 numbers
java.util.Arrays.sort(arr_nums);
System.out.println("The lowest number is " + arr_nums[0]);
System.out.println("The biggest number is " + arr_nums[arr_nums.length-1]);
Last Wiki Answer Submitted: January 25, 2010 11:30 am by Karl Gechlik9,815 pts.
All Answer Wiki Contributors: Karl Gechlik9,815 pts.
If you live outside the United States, by submitting your email address you consent to having your personal data transferred to and processed in the United States.
You should try to solve it by yourself.
If you are not able to do it or you have some specific doubt/problem, post what you have done so far, and we will try to help you.
first sort the array list and get the first element as smallest and the last element in the array is greatest number which is in java.util package of class Arrays.sort(arr_nums);
System.out.println(“The lowest number is ” + arr_nums[0]);
System.out.println(“The biggest number is ” + arr_nums[arr_nums.length-1]);
You should try to solve it by yourself.
If you are not able to do it or you have some specific doubt/problem, post what you have done so far, and we will try to help you.
first sort the array list and get the first element as smallest and the last element in the array is greatest number which is in java.util package of class Arrays.sort(arr_nums);
System.out.println(“The lowest number is ” + arr_nums[0]);
System.out.println(“The biggest number is ” + arr_nums[arr_nums.length-1]);