hi,
suppose i hav a matrix multiplication program written in C... how do i find the time it takes to calculate the result. how do i do that? also, i need the syntax for both windows and linux... thk u..
code if necessary
/legolas
suppose i hav a matrix multiplication program written in C... how do i find the time it takes to calculate the result. how do i do that? also, i need the syntax for both windows and linux... thk u..
code if necessary
code said:#include <stdio.h>
#include <stdlib.h>
void main()
{
int i,j,k;
int a[3][3] = {1,2,3,4,5,6,7,8,9};
int b[3][3] = {9,8,7,6,5,4,3,2,1};
int c[3][3] = {0};
for(i=0;i<3;i++)
{
for(j=0;j<3;j++)
{
for(k=0;k<3;k++)
{
c[j] += a[k] * b[k][j];
}
}
}
printf("\n");
printf("the output is:\n");
for(i=0;i<3;i++)
{
for(j=0;j<3;j++)
{
printf("%d\t",c[j]);
}
printf("\n");
}
getch();
}
/legolas