I need to create an array with 100 numbers (1-100) and then calculate how much it all will be (1+2+3+4+..+100 = sum).
I don\'t want to enter these numbers into the a
int[] nums = new int[100];
int sum = 0;
// Fill it with numbers using a for-loop for (int i = 0; i < nums.length; i++)
{ nums[i] = i + 1; sum += n; }
System.out.println(sum);