I'm using a for loop to create the first 400 multiples of 13, and I'm trying to to store these numbers into an array. The specific issue is on 5th line. I understand that this code is making the programme write to the first element of the array, which is causing the issue. Is there any way I can store the numbers sequentially?
public static void main(String[] args) {
int[] thirteenMultiples = new int[400];
for (int dex = 1; dex < thirteenMultiples.length; dex ++) {
int multiples = 13 * dex;
thirteenMultiples[0] = multiples;
System.out.println(Arrays.toString(thirteenMultiples));
dex, since it's incremented each loop:thirteenMultiples[dex] = multiples.