I have an array of 12 numbers
int ary2[] = {3,5,9,11,15,18,22,23,30,31,35,39};
I want to print the numbers out with 2 places for the number and a space between the numbers.
Example print out would be :
3 5 9 11 15 18 22 23 30 31 35 39
This is how far I got.
for(int i = 0; i < ary2.length; i++)
{
System.out.printf("%-3s", ary2[i]);
}
I'm new at this. Although I won't be directly submitting this as homework, it is affiliated with a homework project of mine; therefore, i'll be using that homework tag anyways.
EDIT: Answer Found.