← All problemsSign in

Roots of a Quadratic Equation

Write a program to take the values for A, B, C of a quadratic equation $A * X^2 + B * X + C = 0$ and then find all the roots of the equation. It is guaranteed that A $\neq$ 0 and that the equation has at least one real root. $x1= \frac{-b + \sqrt{(b^2 - 4ac)}}{2a}$ $x2= \frac{-b - \sqrt{(b^2 - 4ac)}}{2a}$ ###Input: - First line will contain the value of $A$ - Second line will contain the value

HINT LADDERno hints yet
L1 Observation
L2 Technique
L3 Approach
L4 Pseudo-code
🔒
L5 Full solution
L5 unlocks only if you insist twice
solution.cppC++17

CodeSearch Tutor

Hints, not spoilers — it won’t hand over the full solution unless you insist.

voice by Sarvam AI

Sign in to chat with the tutor and save your progress.

Sign in to start