The linear equations in a matrix form are A .X = B and we want to find the values of X. You can solve it in many ways, and one of the simplest ways to solve A.X = B system of equations is Gauss elimination method. It is also known as Reduction method.

This example program solves any kind of linear equation of matrix form using Gauss elimination method.

## Problem Definition

This program asks users to input the number of equations in the system of linear equations. The system of the equation looks like the following if the number of an equation is 3.

Example,

The same system of equation in A . X = B form will be

1112-3211-3 * x1x2x3 = 2-66

You want to find the solution to x1, x2 and x3 using the Gauss elimination method. The Gauss elimination method is done using a series of row and column operations on the coefficient matrix . The coefficient matrix must be a square matrix otherwise the equation will not work.

For example, if we perform a series of row operation on the above matrix.