4 Answers
New AnswerYou 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
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 https://code.sololearn.com/Wj1ruHhSVhw0/?ref=app
Sololearn Inc.
535 Mission Street, Suite 1591Send us a message