CJCoding With Joseph
15free / daySign inCreate account

Quadratic Root Nature

A 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 — print one after the last line.

Hints4 available
Topics:
If Statements
📥 Auto-Input:
1 -3 2
This input is automatically fed to your program's stdin
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.