Problem Statement
Write a function float findRoot(float a, float b, float c) that returns the larger root of the quadratic equation ax^2 + bx + c = 0.
Assume real roots exist (discriminant >= 0).
Formula: (-b + sqrt(b^2 - 4ac)) / (2a).
DEMO-C-32 โข Programming in C
Write a function float findRoot(float a, float b, float c) that returns the larger root of the quadratic equation ax^2 + bx + c = 0.
Assume real roots exist (discriminant >= 0).
Formula: (-b + sqrt(b^2 - 4ac)) / (2a).
Three floats a, b, c.
The larger root.
Submit runs every public testcase in this browser. Results and code never leave this device.
1.0 -3.0 2.0
2.000000
2.0 0.0 -8.0
2.000000
1.0 -5.0 6.0
3.000000
C, C++, Java, and Python run locally in a browser VM. No worker or visualizer is used.
/workspace/question