السلام عليكم
برنامج لضرب مصفوفتين
A , B
و تخزين الناتج في c
المشكله ان الكود لايتنفذ ارجوا المساعده .
int main()
{
int m,n,k,i,j,t;
m=2 , n=3 , k=4 ;
int a[m][n];
int b[n][k];
int c[8][8];
/*enter the value of matrix a */
for(i=0 ; i<m ; i++)
for(j=0 ; j<n ; j++)
{
cin>>a[j];
}
/*enter the value of matrix b */
for(i=0 ; i<m ; i++)
for(j=0 ; j<k ; k++)
{
cin>>b[j];
}
/*initialize the matrix of c */
for(i=0 ; i<m ; i++)
for(j=0 ; j<k ; j++)
{
c[j]=0;
}
/*the result of a an b = c */
for(i=0 ; j<m ; j++)
for(j=0 ; j<k ; j++)
for(t=0 ; t<n ; t++)
{
c[j]=c[j]+a[t]*b[t];
}
return 0;
}
#include<iostream.h>