Problem

The roots of the quadratic equation ax2 + bx + c = 0, a ≠0 are given by the following fo...

The roots of the quadratic equation ax2 + bx + c = 0, a 0 are given by the following formula:

In this formula, the term b2–4ac is called the discriminant. If b2–4ac = 0, then the equation has a single (repeated) root. If b2–4ac > 0, the equation has two real roots. If b2–4ac<0, the equation has two complex roots. Write a program that prompts the user to input the value of a (the coefficient of x2), b (the coefficient of x), and c (the constant term) and outputs the type of roots of the equation. Furthermore, if b2–4ac≥0, the program should output the roots of the quadratic equation. (Hint: Use the function pow from the header file cmath to calculate the square root. Chapter 3 explains how the function pow is used.)

Step-by-Step Solution

Request Professional Solution

Request Solution!

We need at least 10 more requests to produce the solution.

0 / 10 have requested this problem solution

The more requests, the faster the answer.

Request! (Login Required)


All students who have requested the solution will be notified once they are available.
Add your Solution
Textbook Solutions and Answers Search
Solutions For Problems in Chapter 4
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT