(Algebra: solve quadratic equations) The two roots of a quadratic equation ax? + bx + c = 0 can be obtained using the following formula: -b + VB - 4ac and -b - VB - 4ac 2a 2a b - 4ac is called the discriminant of the quadratic equation. If it is positive, the equation has two real roots. If it is zero, the equation has one root. If it is negative, the equation has no real roots. Write a program that prompts the user to enter values for a, b, and c and displays the result based on the discriminant. If the discriminant is positive, display two roots. If the discriminant is 0, display one root. Otherwise, display "The equation has no real roots."

C++ for Engineers and Scientists
4th Edition
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Bronson, Gary J.
Chapter1: Fundamentals Of C++ Programming
Section1.1: Preliminary One: Unit Analysis
Problem 10E: (Thermodynamics) The work, W, performed by a single piston in an engine can be determined by this...
icon
Related questions
Question
(Algebra: solve quadratic equations) The two roots of a quadratic equation
ax? + bx + c = 0 can be obtained using the following formula:
-b + VB - 4ac
and
-b - VB - 4ac
2a
2a
b - 4ac is called the discriminant of the quadratic equation. If it is positive, the
equation has two real roots. If it is zero, the equation has one root. If it is negative,
the equation has no real roots.
Write a program that prompts the user to enter values for a, b, and c and displays the
result based on the discriminant. If the discriminant is positive, display two roots. If the
discriminant is 0, display one root. Otherwise, display "The equation has no real roots."
Transcribed Image Text:(Algebra: solve quadratic equations) The two roots of a quadratic equation ax? + bx + c = 0 can be obtained using the following formula: -b + VB - 4ac and -b - VB - 4ac 2a 2a b - 4ac is called the discriminant of the quadratic equation. If it is positive, the equation has two real roots. If it is zero, the equation has one root. If it is negative, the equation has no real roots. Write a program that prompts the user to enter values for a, b, and c and displays the result based on the discriminant. If the discriminant is positive, display two roots. If the discriminant is 0, display one root. Otherwise, display "The equation has no real roots."
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 3 steps with 3 images

Blurred answer
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ for Engineers and Scientists
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr