Im very sorry about that. Don't know what ESP means. Here's the code.
#include <stdlib.h>
#include <stdio.h>
#include <time.h>
#define N 850
#define T 1000
void multiplyMatrices(double a[N][N], double b[N][N], double
result[N][N]);
void fillMatrix(double a[N][N]);
void prdoubleMatrix(double a[N][N]);
/* Main Method */
main()
{
printf("Hi");
clock_t now,later;
double passed;
//srand( (unsigned)time( NULL ) ); /* Set
initial seed */
printf("RAND MAX is %d\n",RAND_MAX);
double p[N][N] = { 0 }; /* Intializing p
matrix to 0 */
double q[N][N] = { 0 }; /* Intializing q
matrix to 0 */
double r[N][N]= { 0 }; /* Intializing r
matrix to 0 */
now = clock();
fillMatrix(p); /* Randomly fill
Matrix p */
printf("Hi");
printf("Matrix p \n");
printf("======== \n");
//printMatrix(p); /* Display
Matrix p */
fillMatrix(q); /* Randomly fill
Matrix q */
printf("Matrix q \n");
printf("======== \n");
//printMatrix(q); /* Display
Matrix q */
//now = clock();
multiplyMatrices(p, q, r); /* Multiply p and q and put
results in r */
later = clock();
passed = (double) (later - now) / CLOCKS_PER_SEC;
printf("Time taken for multiplication %0.20lf seconds\n", passed);
printf("Matrix r (Matrix p * Matrix q) \n");
printf("============================== \n");
//printMatrix(r); /* Display
Matrix r */
} /* end of main function */
void fillMatrix(double a[N][N]) /* function to fill a matrix with
random numbers */
{
int i, j;
for (i=0; i<N; i++)
{
for (j=0; j<N; j++)
{
a[j] = (double) T * rand() / (RAND_MAX + 1.0);
}
}
}
/* function to multiply two matrices */
void multiplyMatrices(double a[N][N], double b[N][N], double
result[N][N])
{
int i, j, k;
for(i=0; i<N; i++)
{
for(j=0; j<N; j++)
{
for(k=0; k<N; k++)
{
result[j] = result[j] + ( a[k] * b[k][j] );
}
}
}
}
void printMatrix(double a[N][N]) /* function to display the contents
of a matrix */
{
int i, j;
for (i=0; i<N; i++)
{
for (j=0; j<N; j++)
{
printf("%d\t", a[j]);
}
printf("\n");
}
}