rp16vr Amgrambil NewBie
Jumlah posting : 312 Points : 55760 Reputation : 109 Join date : 10.11.09 Age : 34 Lokasi : Tangerang
| Subyek: matkul c++ algoritma... Thu Dec 03, 2009 12:53 pm | |
| eh g mw nge-post ulang pny om fireman ni.. yg tentang array matriks... ni dy codingnya.. #include<iostream.h> void main() { int a,b,c,d; int A[2][2]; int B[2][2]; int C[2][2]; cout<<"A\n"; for(a=0;a<2;a++) { for(b=0;b<2;b++) { cout<<"baris"<<a<<" kolom"<<b<<" :";cin>>A[a][b]; } } cout<<"B\n"; for(a=0;a<2;a++) { for(b=0;b<2;b++) { cout<<"baris"<<a<<" kolom"<<b<<" :";cin>>B[a][b]; } } for(a=0;a<2;a++) { for(b=0,c=0,d=1;b<2;b++) { C[a][b]=A[a][c]*B[c][b]+A[a][d]*B[d][b]; } } cout<<"\n A * B = c\n"; for(a=0;a<2;a++) { for(b=0;b<2;b++) { cout<<A[a][b]<<" "; } cout<<" "; for(b=0;b<2;b++) { cout<<B[a][b]<<" "; } cout<<" "; for(b=0;b<2;b++) { cout<<C[a][b]<<" "; } cout<<endl; } } makasih ni om fireman... | |
|
fireman Amgrambil NewBie
Jumlah posting : 337 Points : 55823 Reputation : 60 Join date : 07.10.09 Age : 35 Lokasi : Indonesia
| Subyek: Re: matkul c++ algoritma... Sun Dec 06, 2009 10:30 am | |
| | |
|