(10%)
Determine whether the following code is correct or not. If it is
correct, predict its output. If it is incorrect, point out the
mistake(s).
// Matrix
#include <iostream>
#include <iomanip>
int main()
{
int a[3][3] = { {2,4,6}, {3,5,7}, {1,6,8} };
int b[3][3] = { {1,4,7}, {2,5,8}, {3,6,9} };
int c[3][3] = { 0 };
int i, j, k;
for (i=0; i<3; i++)
for (j=0; j<3; j++)
for (k=0; k<3; k++)
c[i][j] += a[i][k] * b[j][k];
for (i=0; i<3; i++)
{
for (j=0; j<3; j++)
std::cout << std::setw(4) << c[i][j];
std::cout << std::endl;
}
return 0;
}