#include<iostream>
using namespace std;
void input(int kolom, int baris,int k){
int matrik[100][100];
//input matrik
for (int x = 0;x<baris;x++){
for (int y =0;y<kolom;y++){
cout <<"masukan nilai matrik kedua baris ke-"<<(x+1)<<" kolom ke-"<<(y+1)<<" : ";
cin>>matrik[x][y];
}
}
cout<<endl;
for (int x = 0;x<baris;x++){
for (int y =0;y<kolom;y++){
cout<<matrik[x][y]<<" ";
}
cout<<endl;
}
cout<<endl;
cout<<"setelah di kali kontanta"<<endl;
for (int x = 0; x<baris; x++){
for (int y =0; y<kolom; y++){
matrik[x][y]=k*matrik[x][y];
cout<<matrik[x][y]<<" ";
}
cout<<endl;
}
}
main(){
int baris,kolom,k;
cout<<"masukan baris= " ; cin>>baris;
cout<<"masukan kolom= " ; cin>>kolom;
cout<<"masukan konstanta= "; cin>>k;
cout<<endl;
input(baris,kolom,k);
}
0 komentar:
Posting Komentar