Algorithms | Sololearn: Learn to code for FREE!

+4

Algorithms

Algorithm that will calculate the root a quadratic equation.

3/19/2019 10:53:39 AM

Kcee

4 Answers

New Answer

+1

Total how many algorithms are there in computer science?

+11

You can use the quadratic formula x = (-b ± √(b²-4ac)) / 2a The implementation via programming languages should be pretty straightforward. https://en.m.wikipedia.org/wiki/Quadratic_equation

+6

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

+3

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 https://code.sololearn.com/Wj1ruHhSVhw0/?ref=app