Dibawah ini merupakan Coding C++/CPP Untuk perkalian matriks dengan menggunaka For

#include<iostream>
#include<conio.h>

using namespace std;

int main()
{
                int a[3][3],b[3][3],c[3][3],d[3][3];
                int i,j,k,count;
                for(i=0;i<3;i++)
                                for(j=0;j<3;j++)
                                                cin>>a[i][j];

                for(i=0;i<3;i++)
                                for(j=0;j<3;j++)
                                                b[i][j]=a[j][i];
                cout<<" "<<endl;
                for(i=0;i<3;i++)
                                for(j=0;j<3;j++)
                                                cin>>c[i][j];

                for(i=0;i<3;i++)
                                for(j=0;j<3;j++)
                                                d[i][j]=c[j][i];

                cout<<" "<<endl;
                for(i=0;i<3;i++)
                {
                                for(j=0;j<3;j++)
                                {
                                                count=0;
                                                for(k=0;k<3;k++)
                                                {
                                                                count = count+a[i][k]*b[k][j];
                                                }
                                                c[i][j]=count;
                                }
                }
                cout<<endl;
                                for(i=0;i<3;i++)
                {
                                for(j=0;j<3;j++)
                                                cout<<c[i][j]<<" ";
                                cout<<endl;
                }
                getch();
                return 0;
}

Diatas merupakan Coding lengkap  untuk membuat perkalian matriks pada c++/cpp proggraming Console Anda, Semoga bermanfaat.
Author image
About the Author :

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer nec odio. Praesent libero. Sed cursus ante dapibus diam. Sed nisi. Nulla quis sem at nibh elementum imperdiet. Duis sagittis ipsum.

Connect with him on :