GaussβSeidel Method
Source Code:
Write a program in C to solve the following system using the GaussβSeidel Method:
πππ + π + π = πππ + πππ + π = πππ + π + πππ = π4
#include <stdio.h>
#include <conio.h>
int main(){
clrscr();
double x=0,y=0,z=0,x1,y1,z1;
for(int k=0;k<10;k++){
x1=(12 - y - z)/10
y1=(13 - x1 - z)/10;
z1=(14 - x1 - y1)/10;
x=x1; y=y1; z=z1;
}
printf("\n\n\tx=%.4f\ny=%.4f\nz=%.4f\n",x,y,z);
getch();
return 0;
}
Output

