I'm having a hard time getting this to print the way my professor wants. I have tried print, println, \t, and, \n however the results either come out vertically and side by side or each duplicated number next to each other horizontally. This is what my professor wants:
The results (printed twice) are:
14 81 94 91 47 57 98 89 82 15
14 81 94 91 47 57 98 89 82 15
my outputs have consisted of:
The results (printed twice) are:
14 14
81 81
94 94
91 91
47 47
57 57
98 98
89 89
82 82
15 15
The results (printed twice) are:
14 14 81 81 94 94 91 91 47 47 57 57 98 98 89 89 82 82 15 15
The results (printed twice) are:
14 14 81 81 94 94 91 91 47 47 57 57 98 98 89 89 82 82 15 15
This is my code thus far:
System.out.println("The results (printed twice) are:\t");
for (i = 0; i< arr.length; i++){
arr[i] = rand.nextInt(100) + 1;
int[] arrb = arr.clone();
System.out.print(arr[i] + " " + arrb[i] + " ");