Hello,

I've written this code for LU decomposition

where 'a' is array with values of matrix A, and 'l' and 'u' should containCode:for(int k=0;k<size;k++) { l[k][k]=1; for(int j=k;j<size;j++) { long double sum=0; for(int s=0;s<k-1;s++) { sum+= l[k][s]*u[s][j]; } u[k][j]=a[k][j]-sum; } for(int i=k+1;i<size;i++) { long double sum=0; for(int s=0;s<k-1;s++) { sum+=l[i][s]*u[s][k]; } l[i][k]=(a[i][k]-sum)/u[k][k]; } }

the result of A=LU accordingly.

but the code doesn't give the correct results, and i don't understand why ?

please help