multiplication table in java using array

Solutions on MaxInterview for multiplication table in java using array by the best coders in the world

showing results for - "multiplication table in java using array"
Giulia
27 Sep 2018
1// Multiplication table in java using array
2public class MultiplicationTableUsingArray
3{
4   public static void main(String[] args)
5   {
6      int[][] arrMultipleTable = new int[10][10];
7      int row = 1, column = 1;
8      for(int a = 0; a < arrMultipleTable.length; a++)
9      {
10         for(int b = 0; b < arrMultipleTable[a].length; b++)
11         {
12            arrMultipleTable[a][b] = row * column;
13            column = column + 1;
14         }
15         row = row + 1;
16         column = 1;
17      }
18      for(int a = 0; a < arrMultipleTable.length; a++)
19      {
20         for(int b = 0; b < arrMultipleTable[a].length; b++)
21         {
22            System.out.print(" " + arrMultipleTable[a][b] + "\t| ");
23         }
24         System.out.print("\n");
25      }
26   }
27}