Question

4. In algebra, the values x, or roots, of an (quadratic) equation of the form ax² + bx + c = 0,

where a, b and care real numbers, are calculated using the quadratic formula, namely

x = (-b ± (b²-4ac))/2a.

If the discriminant of this formula, namely

b²-4ac,

is zero, then there is 1 root. If the discriminant is positive, then there are 2 roots. If the

discriminant is negative, then there are 2 complex or imaginary roots. Using C++ code, write

a program to print "1 root", "2 roots" or "2 complex roots" if the discriminant is zero,

positive or negative, respectively, where a, b and care input by a user via the keyboard.