Hi guys,

Can any body help me to solve simultaneous equations using C++ ..?

or What should be my approach to solve the simultaneous equations using C++ ...?

For eg: I have the following equations .......

6x + 5y = 10 // --------------------( 1 )

11x - 3y = 75 // --------------------( 2 )

6x + 5y = 10 // --------------------( 1 )
11x - 3y = 75 // --------------------( 2 )

*To copy to clipboard, switch view to plain text mode *

To solve the above 2 equations i need to

multiply 3 with equation (1) and multiply 15 with equation (2)
Then i will get the following eqauations ....

18x + 15y = 30 // --------------------- (3)

55x - 15y = 75 // --------------------- (4)

18x + 15y = 30 // --------------------- (3)
55x - 15y = 75 // --------------------- (4)

*To copy to clipboard, switch view to plain text mode *

Now let's solve the equations ( 3, 4 ) and i will get the following outoput.

63x = 105

then x = 105/63 ;

63x = 105
then x = 105/63 ;

*To copy to clipboard, switch view to plain text mode *

Now we got the "x" value . // This is what i need programmatically

So my plan is , in my C++ application i just need to take the first 2 equations ( 1, 2 )as inputs. Please tell me which data structure i need to use to accept/store equations( 1, 2) .

Or How to start with this equations..??

thanks in advance.

## Bookmarks