Simultaneous equations are equations that involves two or more unknown variables. There must be as many equations as the number of unknown variables in order for us to solve the problem. In this example, we shall only solve linear simultaneous equations. Linear simultaneous equations take the following forms:

ax+by=m

cx+dy=n

Simultaneous equations can normally be solved by the substitution or elimination methods. In this program, we use the substitution method. Reorganizing the equations derived the following formulas:

x = (b * n - d * m) / (b * c - a * d)

y = (a * n - c * m) / (a * d - b * c)