Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write a C++ program regarding the discriminant(b^2-4ac) of the quadratic formula. The program must be able to read in the value of the a,b, and

Write a C++ program regarding the discriminant(b^2-4ac) of the quadratic formula. The program must be able to read in the value of the a,b, and c of the discriminant and perform the following:

. If the value of the discriminant is positive, program should print out that the equation has two real roots and prints the values of the two roots.

. If the discriminant is equal to 0, the roots are real and equal.

if the value of the discriminant is negative, then the equation has two complex roots.

A sample program is below:

Enter values for a, b and c:- 2 10 3 Discriminant = 76

Equation has two real roots Roots are as follows:- x1 = -0.320551 x1 = -0.320551

Any character to end:-

Please write an explanatory comment on every line of code, thank you in advance.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Modern Database Management

Authors: Jeffrey A. Hoffer Fred R. McFadden

9th Edition

B01JXPZ7AK, 9780805360479

More Books

Students also viewed these Databases questions