Read an array of 5 integer values in the main method. Create a separate function that will determine which number is the biggest. Return the biggest value to the main and print it within the main. I started the code but my problem is that I do not know how to pass the values that I read in the main method (the array values) into the function! I started off like this:
import java.util.*;
public class arraybiggest {
public static int main (String[]args) {
Scanner in = new Scanner(System.in);
System.out.println("Enter 5 values: ");
int [] x = new int[5];
for (int i=0; i<5; i++) {
x[i] = in.nextInt();
return x;
}
}
public static int passarray(int [ ] value) {
}
}
Pls help me! Thanks!