I would like to fill an array using consecutive integers. I have created an array that contains as much indexes as the user enters:
Scanner in = new Scanner(
The simple way is:
int[] array = new int[NumOfValues]; for(int k = 0; k < array.length; k++) array[k] = k + 1;