English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

5 answers

Now replace 3,3 by m and n, or else you may contact a C expert at websites like http://askexpert.info/

2007-12-06 20:29:28 · answer #1 · answered by Anonymous · 0 0

This is Yahoo! Answers, not "Yahoo! Do My Homework For Me"
Do you have a specific question?

2007-12-06 16:14:30 · answer #2 · answered by mdigitale 7 · 0 1

/* Program MAT_MULT.C
**
** Illustrates how to multiply two 3X3 matrices.
**

*/

#include

void mult_matrices(int a[][3], int b[][3], int result[][3]);
void print_matrix(int a[][3]);

void main(void)
{
int p[3][3] = { {1, 3, -4}, {1, 1, -2}, {-1, -2, 5} };
int q[3][3] = { {8, 3, 0}, {3, 10, 2}, {0, 2, 6} };
int r[3][3];

mult_matrices(p, q, r);
print_matrix(r);
}

void mult_matrices(int a[][3], int b[][3], int result[][3])
{
int i, j, k;
for(i=0; i<3; i++)
{
for(j=0; j<3; j++)
{
for(k=0; k<3; k++)
{
result[i][j] = a[i][k] + b[k][j];
}
}
}
}

void print_matrix(int a[][3])
{
int i, j;
for (i=0; i<3; i++)
{
for (j=0; j<3; j++)
{
printf("%d\t", a[i][j]);
}
printf("\n");
}
}

2007-12-06 16:22:19 · answer #3 · answered by viknesh123 1 · 0 2

So what's the going rate for us doing your homework?

2007-12-06 16:20:38 · answer #4 · answered by BillH 5 · 1 1

this application is in C as a substitute of C++, the comparable code, yet i think of as a substitute of printf you write cout<< and as a substitute of scanf u write cin>> and one extra element, i'm hoping you recognize some french :D sturdy luck playstation : attempt it your self first or you will in no way strengthen #comprise #comprise void substantial() { int m1[10][10], m2[10][10]; int nl1, nc1; int nl2, nc2; int i, j, ok, s; waft p[10][10], M; } //matrix a million identity: printf("donner le nb de lignes de la premier matricen"); scanf("%d", &nl1); printf("donner le nb de colonnes de la premier matricen"); scanf("%d", &nc1); for(i=0; i

2016-12-10 15:09:47 · answer #5 · answered by ? 4 · 0 0

fedest.com, questions and answers