Saturday, 18 July 2015

SIMPLE PROGRAMME TO SHOW THE MULTIPLICATION OF TWO MATRICES USING TWO DIMENSIONAL ARRAY.

programme:- to multiply the matrices



public class array5
{
public static void main(String[] args)
{
int x[][]={{3,4},{4,5}};
int y[][]={{1,2},{9,8}};
int i,j;
int z[][]=new int[2][2];
for(i=0;i<2;i++)
{
for(j=0;j<2;j++)
{
z[i][j]=x[i][j]*y[i][j];
System.out.print(z[i][j]);
}
System.out.println();
}
}
}

No comments:

Post a Comment