I'm writing a C code to solve a numerical problem, I define a 100x100 matrix and fill it with values A is the matrix, b is the solution : A[i][j]=1/(i+j+1) , b[i]= the sum of all values in the ith row Following is my code:
#include <stdio.h>
#include <stdlib.h>
#define n 100
int main()
{
double A[n][n];
double b[n];
int i,j;
for (i=0;i<n;i++)
for (j=0;j<n;j++)
{
b[i]=0;
A[i][j]=0;
}
for (i=0;i<n;i++)
for (j=0;j<n;j++)
{
A[i][j]=1/(i+j+1);
b[i]+=A[i][j];
}
int c=10;
for (i=0;i<n;i++)
for (j=0;j<n;j++)
{
printf("%lf\t",A[i][j]);
if (c==j) printf("\n");
c=c*10;
}
return 0;
}
Whenever I click on the build button the Code Blocks terminates, shows this :
Cross platform IDE stopped working
and then the program closes. Can anybody help me to figure out the problem?!