# Thread: Solving systems of linear equations with C programming?

1. ## Solving systems of linear equations with C programming?

How would you solve a system of linear equations using C programming?
The equations are like this:

3a +4b +6c +7d....=34
4a +6b +3c +8d....=26
2a +2b +9c +2d....=84
..............................

Basically, you have 'x' many variables and 'x' many equations, where 'x' is a variable number. I tried converting the system of equations into matrices, like this:

[3, 4, 6, 7,...]______[a]_______[34]
[4, 6, 3, 8,...]_X____[b]____=__[26]
[2, 2, 9, 2,...]______[c]_______[84]
[................]______[...]______[...]

But I have no idea what to do now. I tried looking it up online, and found something called Gaussian Elimination, which seems to be able to solve these types of problems, but I have no idea how it works or how to code it.

2. Then you need to study Gaussian elimination. You can not program the solution to a problem you don't understand. Work through some simple Gaussian elimination problems by hand on paper until you totally understand the process. Google should turn up plenty of resources on that. Then, begin coding in small chunks, testing as you go. If you get stuck, post back and we'll help you.

3. Gaussian elimination is as good a way to go as any to begin with. If you've found it online, then you have found either a text description or the algorithm itself, or both. If I were to post something, it would be a text description or the algorithm, so I don't know what value I can add exactly. I would start with a fixed number of variables/equations, rather than trying to be fancy and solve general nxn.