Java Program for Multiplication of two Matrices
import java.util.Scanner; //import Scanner class in our program class demo { public static void main(String…s) { int i,j,m,n,p,q,k; Scanner sc=new Scanner(System.in); //used to read from keyboard System.out.print(“Enter number of rows and columns of first matrix:”); m=sc.nextInt(); n=sc.nextInt(); System.out.print(“Enter number of rows and columns of second matrix:”); p=sc.nextInt(); q=sc.nextInt(); if(n!=p) System.out.print(“nSorry multiplication can’t be done!!”); else …
