Answers for "Multiplication table in java using array"

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 "Multiplication table in java using array"

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language