Question: 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

The coding language is C In high-school algebra, you learned that the

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

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!