Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save VictorSouzas/d787877d250cf940e463ff4e53e928af to your computer and use it in GitHub Desktop.
Save VictorSouzas/d787877d250cf940e463ff4e53e928af to your computer and use it in GitHub Desktop.
#include <stdio.h>
#define size 1000
int main(){
int i,j,k;
double aux = 0;
static double A[size][size];
static double B[size][size];
static double C[size][size];
for (i = 0; i < size; ++i)
{
for (j = 0; j < size; ++j)
{
A[i][j] = 0.5;
}
}
for (i = 0; i < size; ++i)
{
for (j = 0; j < size; ++j)
{
B[i][j] = 2.0;
}
}
// A line
for (i = 0; i < size; ++i)
{
// B column
for (j = 0; j < size; ++j)
{
// B line
for (k = 0; k < size; ++k)
{
aux += A[i][k] * B[k][j];
}
C[i][j] = aux;
aux = 0;
}
}
/*
for (i = 0; i < size; ++i)
{
for (j = 0; j < size; ++j)
{
printf("%.2f\t", C[i][j]);
}
printf("\n");
}
*/
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment