Multiplication of matrix in java program. The first matrix’s number of columns must equal the number of rows in the second matrix. The resulting matrix, known as the matrix product, has the first matrix’s number of rows and the second matrix’s number of columns.

public class Main

{

public static void main(String args[])

{

int a[][]={{10,10,10},{20,20,20},{30,30,30}};

int b[][]={{10,10,10},{20,20,20},{30,30,30}};

int c[][]=new int[3][3];

for(int i=0;i<3;i++)

{

for(int j=0;j<3;j++)

{

c[i][j]=0;

for(int k=0;k<3;k++)

{

c[i][j]+=a[i][k]*b[k][j];

}

System.out.print(c[i][j]+" ");

}

System.out.println();

}

}

}

Output:

600 600 600

1200 1200 1200

1800 1800 1800

## What is Multiplication of Matrix in Java Program

A mathematical operation that is, at its most basic level, an abbreviated procedure of adding an integer to zero a defined number of times, which is then extended to other numbers using principles that apply to integers.

## What is Multiplication of matrix

The first matrix’s column count must match the second matrix’s row count. The matrix product has the first matrix’s number of rows and the second matrix’s number of columns. The 2×2 Matrix is a decision-making technique in which possibilities are plotted on a two-by-two matrix. A four blocker is also known as a magic quadrant. A simple square divided into four equal quadrants forms the matrix diagram. Each axis indicates a criterion for making a decision, such as price or effort.

## What is for loop in java program

A for statement in Java creates loops with an automatically maintained counter variable. The for statement allows you to specify an initial value for the counter variable, the amount that will be added to it on each loop execution, and the condition that will be evaluated to determine when the loop should end.

### Similar Programs

C++ program to find leap year using nested if

Write a c++ program to check whether the given string is palindrome or not

C++ program to find the sum of n numbers using for loop

Write a program to print factorial of n number in c++

Write a c++ program to print Armstrong number for three digits

c++ program to count the total number of characters in a given text

C++ program to calculate students marks and grade

C++ Program to print the sum of diagonal elements of a matrix

C++ program to swap or transpose a matrix by using multi-dimensional arrays

Pascal triangle pattern program in c++ using for loop

C++ program to print the addition of two numbers using pointers

C++ program to print the minimum and maximum element of the array

C++ program to print the minimum and maximum element of the array

C++ program to print the square root

C++ program to print the cube root of a number

C++ program to calculate Body Mass Index (BMI) with pounds and inches

Break and Continue Statement in C++

C++ program is print the smallest missing element in sorted array

Write a c++ program to print the quick sort algorithm

Write a c++ program to print the selection sort

Write a c++ program to implement merge sort algorithm

Write a c++ program to print the bubble sort

Write a c++ program to print the insertion sort using array