here is the c code

CODE

#include <stdio.h>

#include<conio.h>

int main()

{

int n;

float a[10][11],t;

int i, j,k,max;

for(i = 0; i < n; ++i)

for (j = 0; j < n + 1; ++j)

scanf("%f", &a[i][j]);

for (i = 0; i < n; ++i)

{

max = i;

for (j = i + 1; j < n; ++j)

if (a[j][i] > a[max][i])

max = j;

for (j = 0; j < n + 1; ++j)

{

t = a[max][j];

a[max][j] = a[i][j];

a[i][j] = t;

}

}

for (j = n; j >= i; --j)

for (k = i + 1; k < n; ++k)

a[k][j] -= a[k][i]/a[i][i] * a[i][j];

for (i = n - 1; i >= 0; --i) {

a[i][n] = a[i][n] / a[i][i];

a[i][i] = 1;

for (j = i - 1; j >= 0; --j) {

a[j][n] -= a[j][i] * a[i][n];

a[j][i] = 0;

}

}

for (i = 0; i < n; ++i) {

for (j = 0; j < n + 1; ++j)

printf("%.2f\t", a[i][j]);

printf("\n");

}

getch();

return 0;

}

#include<conio.h>

int main()

{

int n;

float a[10][11],t;

int i, j,k,max;

for(i = 0; i < n; ++i)

for (j = 0; j < n + 1; ++j)

scanf("%f", &a[i][j]);

for (i = 0; i < n; ++i)

{

max = i;

for (j = i + 1; j < n; ++j)

if (a[j][i] > a[max][i])

max = j;

for (j = 0; j < n + 1; ++j)

{

t = a[max][j];

a[max][j] = a[i][j];

a[i][j] = t;

}

}

for (j = n; j >= i; --j)

for (k = i + 1; k < n; ++k)

a[k][j] -= a[k][i]/a[i][i] * a[i][j];

for (i = n - 1; i >= 0; --i) {

a[i][n] = a[i][n] / a[i][i];

a[i][i] = 1;

for (j = i - 1; j >= 0; --j) {

a[j][n] -= a[j][i] * a[i][n];

a[j][i] = 0;

}

}

for (i = 0; i < n; ++i) {

for (j = 0; j < n + 1; ++j)

printf("%.2f\t", a[i][j]);

printf("\n");

}

getch();

return 0;

}

i cannot find out how to create a table in my script for reading the matrix...

Any help appreciated...