I'm having some trouble getting the correct output when printing an array. Essentially what I'm trying to do is set up an array in the main method, then send that array to another method that would print out something like this:

```
   89   12   33   7   72   42   76   49
   69   85   61   23

```

With it being 3 spaces to the right and starting a new print line after the 8th number. Seems easy enough but I get something like this instead. 

```
   89
   69   85   61   23

```

It doesn't print out the values between position 1 and 7 for some reason. This is what I have.

```
public class Test
{
    public static void main (String [] args)
    {
        int [] myInches = {89,12,33,7,72,42,76,49,69,85,61,23};
        printArrayValues(myInches);
    }

    public static void printArrayValues(int [] myInchesParam) {
        for (int i = 0; i < 8; i++) {
            System.out.print("   " + myInchesParam[i]);
            System.out.println();
            for (i = 8; i < 12; i++) {
                System.out.print("   " + myInchesParam[i]);
            }
        }
    }
}

```

Should I use a do-while instead? Or can I still do it with a for loop and I'm just doing it wrong?
['https://Stackoverflow.com/questions/55641172', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/11167410/']
If you insist on using loops, take @Dason's comment and do the following:

```
for(i in 1:length(Letters)) {
  for(j in 1:length(Letters)) {
    Combined <- paste0(Letters[i], ' vs ', Letters[j])
    print(Combined)
    }
}

```
We can either use `expand.grid` or `CJ` (from `data.table`) and then do a `paste`

```
library(data.table)
CJ(Letters, Letters)[, paste(V1, 'vs', V2)]

```