I wrote a C code for solving heat equation, but at the execution it says "Segmentation fault (core dumped)".so can someone help me with this?
<pre><code>#include&lt;stdio.h&gt;

#include&lt;math.h&gt;

#define L 10

#define T 10

#define Kmax 1000

#define N 1000

#define cond 0.25

int main() {    
    int i,j;

    float dt,dx,b;

    float x[i],t[j],u[i][j];        b=2*cond*dt/(dx*dx);    
    for(i=1;i&lt;=N+1;i++)     {       x[i]=i*dx;

        u[i][T]=1;  }   for(j=1;j&lt;=Kmax+1;j++)  {       t[j]=j*dt;

        u[L][j]=0;

        u[N+1][j]=0;

        t[j]=(j)*dt;    }   for(j=1;j&lt;Kmax;j++)         {       for(i=2;i&lt;N;i++)            {

            u[i][j+1]=u[i][j]+0.5*b*(u[i-1][j]+u[i+1][j]-2*u[i][j]);
                        printf("%7.4f\t",u[i][j]);


-----

        printf("\n");       }   } }
</code></pre>