Posted by : Unknown Friday, December 15, 2017

hallo sobat TI! kali ini saya akan membahas bagaimana cara membuat program matrik ordo 2 x 2 dengan dev c++

langsung saja sedot sibat source code

#include <conio.h>
#include <iostream>
using namespace std;
int main(){
int A[2][2], B[2][2], C[2][2];
cout<<“Masukan Matriks A\n”<<endl;
for(int i=0;i<2;i++)
{
for(int j=0;j<2;j++)
{
cout<<“A[“<<i<<“][“<<j<<“]: “;
cin>>A[i][j];
}
}
cout<<“\n\n”;
cout<<“Matriks\n”;
for(int i=0;i<2;i++)
{
for(int j=0;j<2;j++)
{
cout<<” “<<A[i][j];
}
cout<<“\n”<<endl;
}
cout<<“transpose matrik”<<endl;
for(int i=0;i<2;i++)
{
for(int j=0;j<2;j++)
{
B[j][i]=A[i][j];
}
}
for(int i=0;i<2;i++)
{
for(int j=0;j<2;j++)
{
cout<<” “<<B[i][j];
}
cout<<“\n”<<endl;
}
cout<<“jumlah A + B : “<<endl;
for(int i=0;i<2;i++)
{
for(int j=0;j<2;j++)
{
C[i][j]=B[i][j]+A[i][j];
}
}
for(int i=0;i<2;i++)
{
for(int j=0;j<2;j++)
{
cout<<” “<<C[i][j];
}
cout<<“\n”<<endl;
}
getch();
}


Leave a Reply

sudah baca jangan lupa comment and like

Subscribe to Posts | Subscribe to Comments

program factorial bilangan dengan dev c++

#include <iostream> using namespace std; int main() { int b,c; cout<<“program oleh suparto”<<endl; cout<<“masukk...

- Copyright © mari kita berkembang😊 - Blogger Templates - Powered by Blogger - Designed by Johanes Djogan -