-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathGuided1_3.cpp
More file actions
32 lines (26 loc) · 770 Bytes
/
Guided1_3.cpp
File metadata and controls
32 lines (26 loc) · 770 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
#include<iostream>
using namespace std;
int main(){
float matriksA[2][3];
float matriksB[2][3];
float matriksjum[2][3];
for(int i=0;i < 2;i++){
for(int j=0;j < 3;j++){
cout<<"Matriks A["<<i<<"]"<<"["<<j<<"] : ";
cin>>matriksA[i][j];
}
}cout<<"\n";
for(int i=0;i < 2;i++){
for(int j=0;j < 3;j++){
cout<<"Matriks B["<<i<<"]"<<"["<<j<<"] : ";
cin>>matriksB[i][j];
}
}cout<<"\n";
for(int i=0;i < 2;i++){
for(int j=0;j < 3;j++){
matriksjum[i][j]=matriksA[i][j]+matriksB[i][j];
cout<<"Hasil Matriks A + B "<<"["<<i<<"]"<<"["<<j<<"] : "<<matriksjum[i][j]<<endl;;
}
}
return 0;
}