Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

The coding language is C In high-school algebra, you learned that the standard quadratic equation ax2 + bx +c= 0 has two solutions given by

The coding language is C

image text in transcribed

In high-school algebra, you learned that the standard quadratic equation ax2 + bx +c= 0 has two solutions given by the formula - b+ V32 - 4ac X = 2a The first solution is obtained by using + in place of ; the second is obtained by using - in place of I. Write a C program that accepts values for a, b, and c, and then calculates the two solutions. If the quantity under the square root sign is negative, the equation has no real solutions, and your program should display a message to that effect. You may assume that the value for a is nonzero. Your program should be able to duplicate the following sample run: Enter coefficients for the quadratic equation: a: 12 b:-5 c: 6 The first solution is 3 The second solution is 2 the library math.h has the sqrt function. Include math.h in your code. The syntax for the sqrt function is: double sqrt (double val) Also, you can assume that a,b,c are real values. Print the solutions using %g. If there are no solutions, print the statmement "The equation has no real solutions. ". If there is only one solution, print the statement: "The only solution is X ", where X is the number

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

Practical Oracle8I Building Efficient Databases

Authors: Jonathan Lewis

1st Edition

0201715848, 978-0201715842

More Books

Students also viewed these Databases questions

Question

1. Who should participate and how will participants be recruited?

Answered: 1 week ago

Question

3. How would this philosophy fit in your organization?

Answered: 1 week ago