#include <stdio.h>
#define COLS 3
#define ROWS 4
int
main (void)
{
int i,k;
int vec[3]={1,2,2};
int mat[4][3]={{1,1,1},{2,3,1},{1,-1,-1},{0,1,2}};
int prod[4];
for (i=0; i<ROWS; ++i)
{
prod[i] = 0;
for (k=0; k<COLS; ++k)
prod[i] = prod[i] + mat[i][k] * vec[k];
}
printf ("The product is: <");
for (i=0; i<ROWS; ++i)
printf ("%d, ", prod[i]);
printf (">\n");
return (0);
}
The product is: <5, 10, -3, 6, >