Code for matrix sum and product with Java
Code to perform matrix transpose, sum and product of matrices
Code to perform matrix transpose, sum and product of matrices package prodottomatrici; public class ProdottoMatrici {public static void main(String[] args) { int a[][]=new int[3][3]; int t[][]=new int[3][3]; int s[][]=new int[3][3]; int d[][]=new int[3][3]; int p[][]=new int[3][3]; print(inizializza(a)); print(Trasposta(a,t)); s=SommaMatrice(a,t,s); System.out.println("This is the sum of the two previous matrices:"); System.out.println(); print(s); System.out.println("This is the difference of the two previous matrices:"); print(DifferenzaMatrice(a,t,d)); System.out.println(); print(ProdottoMatrice(a,t,p)); } public static int[][] inizializza(int a[][]){ for(int i=0;i