title: Switching between for loop for array printint. Java
body: <p>How can i print an array 10 items per row for 20 rows. Then i want to jump to the next array and do the same. After that ask the user for input to continue or not.</p>
  
  <p>Here is a sample output that i have:</p>
  
  <pre><code>===================================== After Level 1 Merged ==========================================
  
   {   129 } {   133 } {   354 } {   425 } {   632 } {   779 } {  1067 } {  1126 } {  1185 } {  1306 }
   {  1373 } {  1384 } {  1472 } {  1607 } {  1731 } {  1756 } {  1854 } {  1907 } {  1982 } {  2029 }
   {    54 } {   225 } {   259 } {   426 } {   449 } {   683 } {   728 } {   911 } {   920 } {  1009 }
   {  1056 } {  1266 } {  1288 } {  1323 } {  1404 } {  1666 } {  1848 } {  1912 } {  1968 } {  1970 }
   {  1997 } {  2021 }
  
  ===================================== After Level 2 Merged ==========================================
  
   {    54 } {   129 } {   133 } {   225 } {   259 } {   354 } {   425 } {   426 } {   449 } {   632 }
   {   683 } {   728 } {   779 } {   911 } {   920 } {  1009 } {  1056 } {  1067 } {  1126 } {  1185 }
   {  1266 } {  1288 } {  1306 } {  1323 } {  1373 } {  1384 } {  1404 } {  1472 } {  1607 } {  1666 }
   {  1731 } {  1756 } {  1848 } {  1854 } {  1907 } {  1912 } {  1968 } {  1970 } {  1982 } {  1997 }
   {  2021 } {  2029 }
  </code></pre>
  
  <p>Here is my code: </p>
  
  <pre><code>System.out.printf("\nmy header \n\n", MemberConstant.MERGERSEC);
  
      for (int i = 0; i &lt; K; i++) {
          for (int j = brds[i].start; j &lt; brds[i].size + brds[i].start; j++) {
              System.out.printf(" {");
              System.out.printf("%6d ", a[j]);
              cnt1++; 
              System.out.printf("}");
              if(cnt1 == 10) {
                  System.out.printf("\n");
                  mod2++;
                  cnt1=0;
              }
          }  
      } 
  
      cnt1=0;
          System.out.printf("my header\n\n", MemberConstant.MERGERSEC2);
  
          for (int k = 0; k &lt; K; k++) {
          for (int l = brds[k].start; l &lt; brds[k].size + brds[k].start; l++) {
               System.out.printf(" {");
              System.out.printf("%6d ", b[l]);
              cnt1++; 
              System.out.printf("}");
              if(cnt1 == 10) {
                  System.out.printf("\n");
                  mod2++;
                  cnt1=0; 
  
              }
  
          }
      }
  </code></pre>