A={{4,-1,1},{-1,4,-2},{1,-2,4}}//N;
b={12,-1,5}//N;
n=Length[A];
ϵ=0.1;
maxIter=100;
iter=1;
xOld=Table[0,{i,n}];
xNew=Table[0,{i,n}];
For[i=1,i≤n,i++,
sum = 0;
For[j=1,j≤n,j++,
If[j<i,
sum+=A[[i,j]]xNew[[j]]
];
If[j>i,
sum+=A[[i,j]]xOld[[j]]
];
];
xNew[[i]]=((-Sum[A[[i,j]]xOld[[j]],{j,1,i-1}]-Sum[A[[i,j]]xOld[[j]],{j,i+1,n}])/(A[[i,i]]))+((b[[i]])/(A[[i,i]]))
];
While[Norm[xNew-xOld]/Norm[xNew]≥ϵ&&iter<maxIter,
xOld=xNew;
For[i=1,i≤n,i++,
sum = 0;
For[j=1,j≤n,j++,
If[j<i,
sum+=A[[i,j]]xNew[[j]]
];
If[j>i,
sum+=A[[i,j]]xOld[[j]]
];
];
xNew[[i]]=((-Sum[A[[i,j]]xNew[[j]],{j,1,i-1}]-Sum[A[[i,j]]xOld[[j]],{j,i+1,n}])/(A[[i,i]]))+((b[[i]])/(A[[i,i]]))
];
iter++
]
xNew
iter

.