Skip to main content

Quadriatic Equation Solver

In this assignment, you will be writing a Python program that solves quadratic equations. A quadratic equation is a second-degree polynomial equation in a single variable xx with the form:

ax2+bx+c=0ax^2 + bx + c = 0

The solutions to a quadratic equation can be found using the quadratic formula:

x=b±b24ac2ax = \frac{-b \pm \sqrt{b^2 - 4ac}}{2a}

Your task is to write a Python program that takes the coefficients aa, bb, and cc as input and calculates the roots of the quadratic equation using the quadratic formula. The program should output the roots of the equation.

For example, given the coefficients a=5a = 5, b=6b = 6, and c=1c = 1, the program should output the roots x1=0.2x_1 = -0.2 and x2=1.0x_2 = -1.0.