Question: 1. Roots of Quadratic Equation Write a program to compute the roots of a quadratic equation: ax2 + bx + c = 0 using the

 1. Roots of Quadratic Equation Write a program to compute the

1. Roots of Quadratic Equation Write a program to compute the roots of a quadratic equation: ax2 + bx + c = 0 using the well-known quadratic formula: 2a Your program will prompt the user for the values: a, b, c and output each real root. However, for "invalid" input (a0 or values that would result in complex roots), the program will instead output a message that informs the user why the inputs are invalid (with a specific reason). Your output should look like the following Enter the values of a, b, and c: 2 18 0 Output: Roots are 0.00 and -9.00 Enter the values of a, b, and c: 1-23 Output: Would result in a complex root

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!