C language computer programming?

Write a program to compute the real roots of a quadratic equation (ax^2 + bx +c = 0). The roots can be calculated using the quadratic formula.

Your program is to prompt the user to enter the constants (a, b, c). It is then to display the roots based on the following rules:

a. If both a and b are zero, there is no solution.

b. If a is zero, there is only one root (-c/b).

c. If the discriminate (b^2 - 4ac) in negative, there are no real roots.

d. For all other combinations, there are two roots.

Update:

Yes, everything you said is true. I need to write a program that uses that information and calculates it for me.

Please enter comments
Please enter your name.
Please enter the correct email address.
You must agree before submitting.

Answers & Comments


Helpful Social

Copyright © 2024 Q2A.ES - All rights reserved.