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

Clear[digit]; 
digit=7;

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

N[ GaussBasic[A,B], 7]

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

N[ GaussBasic[A,B], 7]