Endless For Loop : <p>This might be a silly question, but i can't actually understand why this FOR loop is running infinitely. The code is given below:</p>

<pre><code>for(int k=0;k&lt;size-1;k++){
    for(int i=k+1;i&lt;size;i++){
        for(int j=k+1;j&lt;size;j++){
            if(k=0){
                a[i][j]=((a[i][j]*a[k][k]) - (a[i][k]*a[k][j]));
            }else{
                a[i][j]=((a[i][j]*a[k][k]) - (a[i][k]*a[k][j]))/a[k-1][k-1];
            }
        }
    }
}
</code></pre>

<p>In my case the value of size is 3, can anyone tell me why this is going to an infinite loop?</p>
