Explain this to me pls

i hv no idea how to do this ques .

hi @paaritoshdhiman
The input corresponds to equation ax^2 + bx + c = 0. Roots = (-b + sqrt(b^2 - 4ac))/2a , (-b - sqrt(b^2 - 4ac))/2a

Algo:

  1. Calculate the D viz, sqrt(b * b - 4 * a * c).
  2. If D < 0,
    2.1 print Imaginary
  3. if D == 0,
    3.1 print Real and Equal
    3.1 Calculate roots using formula ( - b + D) / (2 * a) and (- b - D)/ (2 * a)
    3.2 Print the roots
  4. If D > 0,
    4.1 print Real and Distinct
    4.2 Calculate roots using formula ( - b + D) / (2 * a) and (- b - D)/ (2 * a)
    4.3 print the roots (in non-decreasing order)
  5. End

refer this code -->

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.