Gauss Elimination method for solving n-linear equations in C language

This is a simple C language program that calculates solution of n-linear equations using Non-pivotal Gauss Elimination method. It uses upper triangular matrix to do so, for solution using lower triangular matrix visit here.

#include
#include

float matrix[10][10], m, temp[10];
int i, j, k, n;

void upper_triangularization() {
	for (i=0; i=0; i--) {
		m	= matrix[i][n];
		for (j=n-1; j>i; j--)
			m	= m - temp[n-j] * matrix[i][j];
		temp[n-i]	= m/matrix[i][i];
		printf("\n x%d => %f", i+1, temp[n-i]);
	}
} // back_subsitution

void main() {
	printf("Enter number. of variables :: ");
	scanf("%d", &n);
	
	printf("Enter the augmented matrix: \n");
	for (i=0; i

                         
Follow me
Latest posts by Abhishek Gupta (see all)

One Reply to “Gauss Elimination method for solving n-linear equations in C language”

  1. oh my god that’s finally done thanks man..!! none of the websites helped me properly… but your one is correct

Leave a Reply