Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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
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. 6Type or paste question here
CH.5: (pg. 178-183) 2. filename: quadratics.c (use quadratics.out with input files quadratics_input1, quadratics_input2, quadratics_input3) In high-school algebra, you learned that the standard quadratic equation ax2 + bx+c=0 has two solutions given by the formula -b+ 32 - 4ac 2a The first solution is obtained by using + in place of ; the second is obtained by using - in place of +. 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: 62 The first solution is 3 The second solution is 2Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started