The general form of the quadratic equation can be written as follows:

\[ax^2 + bx + c = 0\]

where a, b and c are known real numbers, called equation coefficients. In order to calculate the roots of this equation, or to find solutions, we will use generally known formulas:

\[x_{1}=\frac{-b+\sqrt[]{\Delta }}{2a}, \ \

x_{2}=\frac{-b-\sqrt[]{\Delta }}{2a} \hspace{1.5cm} for \ \Delta >0\]

x_{2}=\frac{-b-\sqrt[]{\Delta }}{2a} \hspace{1.5cm} for \ \Delta >0\]

or

\[x=\frac{-b}{2a}\ \ \qquad\ \qquad\ for\ \Delta=0\]

When

\[\Delta<0\]

the equation has no solution.
\[\Delta=b^2-4ac\]

Implementation of the algorithm in: Pascal, C++, Java, Python, JavaScript

Description of the algorithm:

- Start - our algorithm starts here.
- We load input data - coefficients a, b and c of the equation.
- We check if the coefficient a of the equation is equal to 0.
- If a = 0 we deal with a linear equation, we invoke the algorithm of solving the linear equations.
- We calculate the delta value.
- We check if the delta is less than 0.
- If delta <0 we print information, the equation has no solutions.
- We check if the delta is equal to 0.
- If delta = 0, we calculate the value of one double solution x.
- When delta = 0, after calculating x, we write its value.
- We reach this point when none of the previous conditions have been met (delta <0 and delta = 0), i.e. when delta> 0. We calculate the values of two solutions of the equation: x
_{1}and x_{2}. - We print the calculated values of both solutions.
- Stop - the end of the algorithm common to all roads.