public class Test { public static void main(String[] args) { Scanner in = new Scanner(System.in);
System.out.println("Please enter the size of an array: "); int size = in.nextInt(); int [] array = new int[size]; for (int i = 0; i < size; i++) { System.out.println("Please enter element #" + i + ": "); array[i] = in.nextInt(); }
System.out.println("Here is your array: "); for (int i = 0; i < size; i++) System.out.print(array[i] + " "); } }
"assignmentexpert.com" is professional group of people in Math subjects! They did assignments in very high level of mathematical modelling in the best quality. Thanks a lot
Comments
Leave a comment