Answers for "how to make a multiplication table in java using arrays"

1

Multiplication table in java using array

// Multiplication table in java using array
public class MultiplicationTableUsingArray
{
   public static void main(String[] args)
   {
      int[][] arrMultipleTable = new int[10][10];
      int row = 1, column = 1;
      for(int a = 0; a < arrMultipleTable.length; a++)
      {
         for(int b = 0; b < arrMultipleTable[a].length; b++)
         {
            arrMultipleTable[a][b] = row * column;
            column = column + 1;
         }
         row = row + 1;
         column = 1;
      }
      for(int a = 0; a < arrMultipleTable.length; a++)
      {
         for(int b = 0; b < arrMultipleTable[a].length; b++)
         {
            System.out.print(" " + arrMultipleTable[a][b] + "\t| ");
         }
         System.out.print("\n");
      }
   }
}
Posted by: Guest on February-19-2021

Code answers related to "how to make a multiplication table in java using arrays"

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language