Print an array elements
<p>This is my first post and I'm still a beginner in the programming world so bear with me. I just created an array with 100 initialized values and I want to print out 10 elements on each line so it would be somthing like this</p>

<pre><code>0 1 2 3 4 5 6 7 8 9
10 11 12 13 14 15 16
...26
</code></pre>

<p>this is the code i used and i managed to do it for the first 10 elements but I couldn't figure out how to do it for the rest </p>

<pre><code> public static void main(String[] args) {
  int[] numbers = { 0,1,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17};


  int i, count = 0;

  for (i = 0; i &lt; numbers.length; i++) {

   System.out.print(numbers[i] + " ");
   count++;

   if (count == 9)
    for (i = 9; i &lt; numbers.length; i++)

     System.out.println(numbers[i] + " ");

  }

 }
</code></pre>

<p>Thanks!</p>
