-
Notifications
You must be signed in to change notification settings - Fork 0
/
3x3 Matrix Multiplication
55 lines (46 loc) · 1.19 KB
/
3x3 Matrix Multiplication
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
#include <stdio.h>
int matris1[3][3];
int matris2[3][3];
int toplammatris[3][3];
int i, j;
int main() {
for (i = 0; i < 3; i++) {
for (j = 0; j < 3; j++) {
printf("Matrisin %dx%d elemanini giriniz:\n", i + 1, j + 1);
scanf("%d", &matris1[i][j]);
}
}
for (i = 0; i < 3; i++) {
for (j = 0; j < 3; j++) {
printf("\nMatrisin %dx%d elemanini giriniz:\n", i + 1, j + 1);
scanf("%d", &matris2[i][j]);
}
}
printf("Birinci Matrisiniz:\n");
for (i = 0; i < 3; i++) {
printf("\n");
for (j = 0; j < 3; j++) {
printf("%d\t", matris1[i][j]);
}
}
printf("Ikinci Matrisiniz:\n");
for (i = 0; i < 3; i++) {
printf("\n");
for (j = 0; j < 3; j++) {
printf("%d\t", matris2[i][j]);
}
}
for (i = 0; i < 3; i++) {
for (j = 0; j < 3; j++) {
toplammatris[i][j] = matris1[i][j] + matris2[i][j];
}
}
printf("\nIki Matrisin Toplami:\n");
for (i = 0; i < 3; i++) {
printf("\n");
for (j = 0; j < 3; j++) {
printf("%d\t", toplammatris[i][j]);
}
}
return 0;
}