← Back to If Statements
Question 389
Quadratic Root Nature
Quadratic Root Nature
A quadratic equation has the forma*x*x + b*x + c = 0(withanot zero). Read three doublesa,b, andc. Compute the discriminantd = b*b - 4*a*cand print the nature of the roots: -d > 0->Two real roots-d == 0->One real root-d < 0->No real rootsFor example, given the input1 -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 — 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.