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

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
Get step-by-step solutions from verified subject matter experts
