Programın Kodu
#include <iostream>
using namespace std;
int main(){
int bir[3][3], iki[3][3], sonuc[3][3];
for(int i=0;i<3;i++){
for(int j=0;j<3;j++){
cout << "Birinci Matris [" << i+1 << "][" << j+1 << "] =";
cin >> bir[i][j];
}
}
cout << endl;
for(int i=0;i<3;i++){
for(int j=0;j<3;j++){
cout << "İkinci Matris [" << i+1 << "][" << j+1 << "] =";
cin>> iki[i][j];
}
}
cout << endl;
for(int i=0;i<3;i++){
for(int j=0;j<3;j++){
sonuc[i][j]=bir[i][j]+iki[i][j];
}
}
cout << "Matrislerin toplam:\n\n";
for(int i=0;i<3;i++){
for(int j=0;j<3;j++){
cout <<sonuc[i][j]<<" ";
}
cout << endl<<endl;
}
system("pause");
return 0;
}
using namespace std;
int main(){
int bir[3][3], iki[3][3], sonuc[3][3];
for(int i=0;i<3;i++){
for(int j=0;j<3;j++){
cout << "Birinci Matris [" << i+1 << "][" << j+1 << "] =";
cin >> bir[i][j];
}
}
cout << endl;
for(int i=0;i<3;i++){
for(int j=0;j<3;j++){
cout << "İkinci Matris [" << i+1 << "][" << j+1 << "] =";
cin>> iki[i][j];
}
}
cout << endl;
for(int i=0;i<3;i++){
for(int j=0;j<3;j++){
sonuc[i][j]=bir[i][j]+iki[i][j];
}
}
cout << "Matrislerin toplam:\n\n";
for(int i=0;i<3;i++){
for(int j=0;j<3;j++){
cout <<sonuc[i][j]<<" ";
}
cout << endl<<endl;
}
system("pause");
return 0;
}