title: How can a multiplication table be displayed using only nested for loops and System.out.println in Java?
body: <pre><code>public static void main (String [] args)
  {       
      int q, r, s, t, u, v, w, x, y, z;
  
      for (q=1; q&lt;=10; q++)
      { 
          System.out.print("\t" + q);
      }
      System.out.println();
      for (r=2; r&lt;=20; r += 2)
      {
          System.out.print("\t" + r);
      }
      System.out.println();
      for (s=3; s&lt;=30; s += 3)
      {
          System.out.print("\t" + s);
      }
      System.out.println();
      for (t=4; t&lt;=40; t += 4)
      {
          System.out.print("\t" + t);
      }
      System.out.println();
      for (u=5; u&lt;=50; u += 5)
      {
          System.out.print("\t" + u);
      }
      System.out.println();
      for (v=6; v&lt;=60; v += 6)
      {
          System.out.print("\t" + v);
      }
      System.out.println();
      for (w=7; w&lt;=70; w += 7)
      {
          System.out.print("\t" + w);
      }
      System.out.println();
      for (x=8; x&lt;=80; x += 8)
      {
          System.out.print("\t" + x);
      }
      System.out.println();
      for (y=9; y&lt;=90; y += 9)
      {
          System.out.print("\t" + y);
      }
      System.out.println();
      for (z=10; z&lt;=100; z += 10)
      {
          System.out.print("\t" + z);
      }
  
  }
  </code></pre>
  
  <p>Despite how ridiculous this program looks, it displays a multiplication table in the desired format. Being a noob (as you can see) and trying to learn these nested loops has been very confusing, especially when the tutorial says that this multiplication table, in the same exact format, can be written using just nested for loops and System.out.println. The tutorial is not the least bit helpful and gives a rather simple use of nested for loops and right now I cannot see how it's applicable in simplifying this program....but it says it can be done so it can. </p>