-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmatrixmultiplication.java
More file actions
34 lines (29 loc) · 880 Bytes
/
matrixmultiplication.java
File metadata and controls
34 lines (29 loc) · 880 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
import java.util.Scanner;
class matrixmultiplication{
int m[][];
int r,cl;
matrixmultiplication(int b,int c){
r=b;
cl=c;
m = new int[b][c];
}
matrixmultiplication multiply(matrixmultiplication a){
this.m
}
public static void main(String args[]){
System.out.println("Enter the number of rows and columns of first matrix");
int r1=scan.nextInt();
int c1=scan.nextInt();
System.out.println("Enter the number of rows and columns of second matrix");
int r2=scan.nextInt();
int c2=scan.nextInt();
if(c1!=r2){
printf("matrix multiplication not possible");
}else{
System.out.println("Enter the elements of the first matrix")
matrixmultiplication m1= new matrixmultiplication(r1,c1);
matrixmultiplication m2= new matrixmultiplication(r2,c2);
matrixmultiplication m3= new matrixmultiplication(r1,c3);
}
}
}