How to solve "ax^3+bx^2+cx+d=0" equation using C and Python. | Sololearn: Learn to code for FREE!

+1

How to solve "ax^3+bx^2+cx+d=0" equation using C and Python.

4/10/2021 4:44:23 PM

Anikur Rahman

8 Answers

New Answer

+4

Anikur Rahman how about this solution: https://code.sololearn.com/cNeVFjW55J4I/?ref=app

+2

Why do you not use this method?

+2

hmm, cubic polynomial... unless we know the values of either x or abc. then it can only be done :P usually in mathematics, it's done through ab + bc + cd = c/a

+2

Anikur Rahman use Cardano formula

+1

Do you know how this will be done in mathematic?

+1

I doubt if that code from jaScript is correct cos that's not the expected answer. I substitute x for all the results and none is equal to zero as claimed by the equation. However, i'd suggest you learn a equations like this from some online math tutorials, then you can write them as code

0

JaScript why not? Yes.

0

Mirielle[ Exams ] JaScript Coding Kitty Илья Мирошник Thanks to all who gave answers