Quadratic Root Nature
hardQuestion 389A quadratic equation has the form a*x*x + b*x + c = 0 (with a not zero). Read three doubles a, b, and c. Compute the discriminant d = b*b - 4*a*c and print the nature of the roots:
- d > 0 -> Two real roots
- d == 0 -> One real root
- d < 0 -> No real roots
For example, given the input 1 -3 2, the discriminant is 1, so the program prints the output shown in Expected Output.
Expected output
Two real roots= newline. The output ends with a newline, so print one after the last line.
Hints4 available
Sign in to use hintsTopics
If Statements
1
Tab to indent (Esc then Tab to move on) · Ctrl+Enter to run · Shift+Alt+F to format · Ctrl+Space to expand shortcuts (cout, fori)
Your output
Run your code to see the output here...
Test cases
Run your code to see test case results.