Off[General::spell1];
Clear[LUdeco,a0];
LUdeco[a0_] :=
Module[{a, i,j,k,p,q,m, n},
  a = a0; 
  n= Length[a];
    Module[{i,j},  
   x = Table[0,{i,n},{j,n}];
    Clear[i,j,k,m,p,q]; 
    For[k=1, k <=n, k++,
      x[[k,k]]= N[a[[k,k]]-
          Sum[x[[k,m]] x[[m,k]], 
            {m,1,k-1}],digit]  ;  
      For[j=k+1,j<=n,j++,
       x[[k,j]]= N[(a[[k,j]]- 
         Sum[x[[k,p]] x[[p,j]], 
         {p,1,k-1}])/ x[[k,k]],digit] ]; 
      For[i=k+1,i<=n,i++,
       x[[i,k]]= N[a[[i,k]]- 
          Sum[x[[i,q]] x[[q,k]], 
            {q,1,k-1}],digit]  ]; 
    ]; ]; 
    Clear[L,U,LU];
     L=Table[If[i >=j, x[[i,j]], 0],  				{i,n},{j,n}];
     U=Table[If[i !=j,  If[i < j, 
     	x[[i,j]], 0],  1],{i,n},{j,n}];  
   Return[x]; ];  
 On[General::spell1];

Clear[digit]; 
digit = 10;

Clear[A];
A={{60,30,20}, {30,20,15}, {20,15,12}};
MatrixForm[A]

Clear[LU, L, U];
LU = LUdeco[A];  
MatrixForm[LU]

MatrixForm[L]//N
MatrixForm[U]//N

MatrixForm[L.U ]

Clear[A];
A = {{2,4,-4,0},{1,5,-5,-3},{2,3,1,3},{1,4,-2,2}}; 
MarixForm[A]

Clear[LU,L,U];
LU = LUdeco[A]; 
MatrixForm[LU]//N

MatrixForm[L]//N
MatrixForm[U]//N

MatrixForm[L.U ]

Off[General::spell1];
Clear[SolveLU,a0,b0];
SolveLU[a0_,b0_] :=
Module[{a,b,x,k,sum, n},
  a = a0;
  b = b0;
  n= Length[b];
    x = Table[0,{i,n}];
    Clear[i,j]; 
    For[i=1, i <=n, i++,
      x[[i]] = N[(b[[i]] - 
          Sum[a[[i,j]] x[[j]],
       {j, 1, i-1}])/a[[i,i]],digit]; ];
    Clear[i,j];
    For[i=n,1<=i,i--,
      x[[i]]= N[x[[i]]-Sum[a[[i,j]]*
        x[[j]],{j,i+1,n}],digit]; ]; 
  Return[x]; ];
On[General::spell1];

A = {{2,4,-4,0},{1,5,-5,-3},{2,3,1,3},{1,4,-2,2}};
B = {12,18,8,8}; 
MatrixForm[A]

LU = LUdeco[A];
X = SolveLU[LU,B]