We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 7c0ecee commit 3ae4be7Copy full SHA for 3ae4be7
matrix_multiplication.cpp
@@ -0,0 +1,41 @@
1
+//write a programme to implement matrix multiplication
2
+#include<iostream>
3
+using namespace std;
4
+int a[50][50],b[50][50],c[100][100];
5
+int i,j,k,p,q,m,n,r,s;
6
+cout<<"enter size of matrix1"<<endl;
7
+cin>>m>>n;
8
+cout<<"enter size of matrix 2"<<endl;
9
+cin>>r>>s;
10
+for(i=0;i<n;i++)
11
+{
12
+ for(j=0;j<m;j++)
13
+ {
14
+ cin>>a[i][j];
15
+ }
16
+}
17
+cout<<"enter second matrix"<<endl;
18
+for(i=0;i<s;i++)
19
20
+ for(j=0;j<r;j++)
21
22
+ cin>>b[i][j];
23
24
25
26
27
+ for(j=0;j<s;j++)
28
29
+ for(k=0;k<m;k++)
30
31
+ *(*(c+i)+j)+=*(*(a+i)+j)*(*(*b+k)+j);
32
33
34
35
36
37
38
39
+ cout<<c[i][j];
40
41
0 commit comments