Update CountNumbers.java

This commit is contained in:
Siwat Sirichai 2020-10-20 16:36:54 +00:00
parent b29ed68420
commit a3b1782237
1 changed files with 1 additions and 0 deletions

View File

@ -13,6 +13,7 @@ public class CountNumbers {
int[] int_array = new int[length]; //Create an array with length number of elements
sc = new Scanner(new File("numbers.txt")); //Send the Scanner's cursor to the top of the file
for(int i = 0;i<int_array.length;i++)int_array[i]=sc.nextInt(); //populate the array with the file's value
for(int i = 0;i<int_array.length;i++)int_array[i]++; //increase each elements by one
System.out.println("The number of integers greater than 25: "+greater(int_array,25));
System.out.println("The number of integers greater than 25: "+greater(int_array,50));
System.out.println("The number of integers greater than 25: "+greater(int_array,75));