void mult_matrix double m1 double m2 double res double temp for int fo

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
void mult_matrix(double m1[N][N], double m2[N][N], double res[N][N])
{
double temp = 0;
for (int i = 0; i < N; i++)
{
for (int j = 0; j < N; j++)
{
temp = 0;
for (int k = 0; k < N; k++)
{
temp += m1[i][k] * m2[k][j];
}
res[i][j] = temp;
}
}
for (int i = 0; i < N; i++)
{
for (int j = 0; j < N; j++)
{
m2[i][j] = res[i][j];
}
}
}