title: Java Multiplication
body: <p>How will do a program that displays a multiplication table based on the size that the user inputs? And will add each row and each column? Something like this:</p>
  
  <pre><code>Enter a number: 4
  1   2   3   4   10  
  2   4   6   8   20
  3   6   9   12  30
  4   8   12  16  40
  10  20  30  40  
  </code></pre>
  
  <p>I tried this:</p>
  
  <pre><code>Scanner s = new Scanner(System.in);
  System.out.print("Enter a number: ");
  int x = s.nextInt();
  for(int i = 1; i &lt;= x; i++)  
  {  
      for (int j = 1; j &lt;=x; j++)  
      {  
          System.out.print((i*j) + "\t");  
      }  
      System.out.println();  
  }
  </code></pre>
  
  <p>Sample Output:</p>
  
  <pre><code>Enter a number: 4
  1   2   3   4   
  2   4   6   8   
  3   6   9   12  
  4   8   12  16
  </code></pre>
  
  <p>How I will do to add each row and each column?</p>