Click here to Skip to main content
15,880,972 members
Please Sign up or sign in to vote.
3.50/5 (5 votes)
See more:
Can any1 help me wid the designing of a program in C/C++ to solve a linear equation of degree 5 i.e. the no. of equations is 5 and 5 variables are dere... Suggest me some ideas man...
Sergey Alexandrovich Kryukov 13-Jan-11 14:03pm    
Ok, you don't even need degree 4, right?
Sergey Alexandrovich Kryukov 13-Jan-11 14:06pm    
I'm not going to answer by two reasons: you show no effort and I'm not sure you appreciated previous answers.
Paritosh Prateek 13-Jan-11 14:11pm    
i dnt need degree 4, upto degree 3 i can do tht... also urs is the first reply so no point of not appreciating previous ones.. and wht effort u need...
fjdiewornncalwe 13-Jan-11 14:31pm    
If you can do up to 3, then you can do up to 5. Do your own homework. Show us the code where things went wrong and we'll jump at the chance to help you.
Manfred Rudolf Bihy 13-Jan-11 14:34pm    
I do agree with Marcus here. If you can do 3 then 5 (n even) isn't the problem. You might still want to look at the link I posted in my answer. The method you're really after is called "Gaussian Elimination" and is an algorithm that work for any degree (given that you have enough memory of course). :)

There are lots of sites just google this "gaussian elimination C++". One of the hits directed me there:[^].

I would have like to recommend you a very good book by two authors "Ilja Nikolajewitsch Bronstein and Konstantin Adolfowitsch Semendjajew", but had to discover I couldn't find an english translation of it. It's a book that I used during my studies of computer science in Germany and has a great chapter on algorithms for solving linear equations of n degrees. Maybe you can google some more and find a translation.

The link I posted is to C++ code for a specialization of the "Gaussian Elimination" method called "Gauss-Seidel" algorithm.

Hope this helps some!

Best Regards,
Share this answer
fjdiewornncalwe 13-Jan-11 14:50pm    
Nice. I wasn't willing to dig for a resource for him today...
Manfred Rudolf Bihy 13-Jan-11 15:02pm    
Ok then, so lets take turns.
Next one is yours then! :)
Espen Harlinn 13-Jan-11 15:12pm    
5+ Good answer
Paritosh Prateek 13-Jan-11 15:15pm    
@ Marcus : frm ur post i assumed tht.. :)
Aescleal 15-Jan-11 3:44am    
I wouldn't worry about recommending non-English books as long as you say clearly that they aren't in English. There are plenty of people that could find it useful.
While Manfred is 100% right here is a useful link to several "respected" implementations:
The Object-Oriented Numerics Page[^]

May come in handy one day, and it's certainly a great learning source.

Espen Harlinn
Share this answer
Paritosh Prateek 13-Jan-11 15:19pm    
yup its grt...all in one.. thnx :)
Manfred Rudolf Bihy 13-Jan-11 15:20pm    
Wow Espen! That is really a sh*tload full of libaries on that site. Good link! 5+
Espen Harlinn 13-Jan-11 15:38pm    
Thanks Manfred - it's one of those sites that is easy to overlook
You can use gauss elimination method. following are the major steps
1. create a Coefficient matrix.
2.reduce to upper triangular form, using row, or column wise operations
3. now u can start equating Coefficient from last to first.

Share this answer
Paritosh Prateek 14-Jan-11 7:19am    
thnx man... :)

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900