/********************************************************************** Programme qui calcule la multiplication de 2 matrices Un message d'erreur est affiche si la multiplication est impossible Le resultat est stocke dans une troisieme matrice qui est affichee http://www-sop.inria.fr/oasis/personnel/Carine.Courbis/c/ ************************************************************************/ #include #define NB_LIG1 3 #define NB_COL1 4 #define NB_LIG2 4 #define NB_COL2 2 int main() { int mat1[NB_LIG1][NB_COL1] = {{1,2,3,4}, {5,6,7,8}, {9,10,11,12}}; int mat2[NB_LIG2][NB_COL2] = {{10,20}, {30,40}, {50,60}, {70,80}}; /* Declaration de la matrice resultat */ int mat3[NB_LIG1][NB_COL2]; int i,j,k; /* teste si les bornes des matrices sont compatibles pour l'addition */ if (NB_COL1 == NB_LIG2) { /* mat3 = mat1*mat2 */ for (i=0; i