/* I am offering the following as a time-saver in doing the problem of matrix reduction. The following is what one student wrote two years ago. Except I deleted the calculations, leaving you with the input-output routines. I am doing this because those routines present difficulties that have very little to do with the mathematics of this course. You can use this more or less as is, or modify it slightly. The way it's written you enter a square matrix. Of course any matrix can be handled this way, since you can make a matrix square by adding zeros. Nevertheless, it might be slightly nicer to ask for both the number of rows and the number of columns, and then display the matrix accordingly. The routine ouptut() shows what I want: I want a calculation of the determinant; if this determinant is non-zero, then the inverse is calculated; if zero, then a row- (or column-) reduction is given. All these calculations can be made in parallel if you follow the outline on page 35. See also Exercise 12 on page 52. You can compile and run this program as is; it of course won't give the right answer, but it will give you a feeling for how the program should feel when it runs. You won't see the alternative of det=0 when you do it this way. This is only a suggestion. There are other good ways to do it. Please include in your program a statement that you have not previously done this exercise or something similar in another course. */ #include #define MAX 50 float mat[2*MAX][MAX]; int n; float det=1.; /*******************************************************************/ main () { input(); calc(); output(); } /*******************************************************************/ calc() { } /******************************************************************/ input() { int i,j,k; printf("Input the size of the matrix: "); scanf("%d",&n); printf("\n"); printf("Input the matrix (by rows):\n"); for (i=0; i