Algorithms | Sololearn: Learn to code for FREE!



Algorithm that will calculate the root a quadratic equation.

3/19/2019 10:53:39 AM


4 Answers

New Answer


Total how many algorithms are there in computer science?


You can use the quadratic formula x = (-b ± √(b²-4ac)) / 2a The implementation via programming languages should be pretty straightforward.


If you only want real (non complex) roots, first check that the discriminant (b^2-4ac) is not negative.


Kcee if you need to build a algorithm that will solve quadratics then you can check out this code I have build a algorithms that does it by completing the Squares