Question: I have this code written up for my numerical analysis class. we are doing gussian elemination. this code works but not for the degeracies. I

I have this code written up for my numerical analysis class. we are doing gussian elemination. this code works but not for the degeracies. I was told to get this to work for the degeneracies as well that I have to try and swap the largest absolute equation so I dont divide by a 0. How can I write that in C syntax as part of my gussian elemination code.  I have this code written up for my numerical analysis class.
we are doing gussian elemination. this code works but not for the

6 7 8 9 int main() { char fname[100); FILE *f ; double m[20] [20],d, sum=0.0 ; int n; int r,c,s,i,j,k ; double x[10); 10 11 12 13 14 15 16 17 18 19 printf("enter the name of the file to be read : "); scanf("%s", fname); f = fopen(fname, "r"); //"r" is reading the file if (f == NULL) { //important if file doesnt have anything it doesnt say @ i printf("can't read file "); exit(0); } 20 fscanf(f,"%d",&n); // scanning the file and reads first number to scan for (r = 1; r j) { c=m[i][j]/mjlj); // if mjlj) is o got a problem for(k=1; k=1;i--){ // loop for backward substitution sum=0; for(j=i+1;jj) { c=m[i][j]/mjlj); // if mjlj) is o got a problem for(k=1; k=1;i--){ // loop for backward substitution sum=0; for(j=i+1;j

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!