โ 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: Two real roots
Expected Output:
Two real roots
Topics:
If Statements
Code Editor
1
Tab to indent ยท Ctrl+Enter to run ยท 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.