EBOOK 4.1

1.) C++
#include <iostream>
using namespace std;
/* run this program using the console pauser or add your own getch, system("pause") or input loop */

int main(int argc, char** argv) {
int m,n,c,d,first[10][10],second[10][10],sum[10][10];
cout<<" masukan baris dan colom : \n";
cin>>m>>n;
cout<<"masukan angka : \n";
for(c=0;c<m;c++){
for(d=0;d<n;d++){
cin>>first[c][d];
}
cout<<endl;
}
cout<<" balikannya : \n";
for(c=0;c<m;c++){
for(d=0;d<n;d++){
cout<<first[d][c];
}
cout<<endl;
}

for(c=0;c<m;c++){
for(d=0;d<n;d++){
sum[c][d]=first[c][d]+first[d][c];
}
}
cout<<"jumlah\n";
for(c=0;c<m;c++){
for(d=0;d<n;d++){
cout<<sum[c][d]<<"\t";
cout<<endl;
}
}

    return 0;
}

Share this

Related Posts

Previous
Next Post »