PROGRAM C++ ISI MATRIKS
//IsiMatrik.cpp
#include <iostream>
#include <iomanip>
using namespace std;
int main() {
const int baris=2, kolom=2;
int A[baris][kolom];
int brs, kol;
// mengisi Matrik
for (brs=0; brs < baris; brs++) {
for (kol=0; kol < kolom; kol++) {
cout << "Masukkan elemen baris - " << brs+1
<< " kolom ke - " << kol+1 << " : ";
cin >> A[brs][kol];
}
cout << endl;
}
// menampilkan isi Matrik
cout << "\n\nIsi Matrik :\n";
for (brs=0; brs < baris; brs++) {
for (kol=0; kol < kolom; kol++) {
cout << setw(5) << A[brs][kol] << " ";
}
cout << endl;
}
cout << endl;
system("PAUSE");
return 0;
}
0 Response to "PROGRAM C++ ISI MATRIKS"
Post a Comment