please share the code of this challenge as i am unable to get the logic
Help me the code of this challenge
hello @Anku47
for this problem u just have to use this formula -->
The input corresponds to equation ax^2 + bx + c = 0.
Roots = (-b + sqrt(b^2 - 4ac))/2a , (-b - sqrt(b^2 - 4ac))/2a
algo->
- Calculate the D viz, sqrt(b * b - 4 * a * c).
- If D < 0,
2.1 print Imaginary - 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 - 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) - End
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.