1. Engineering
  2. Computer Science
  3. c programming only please...

Question: c programming only please...

Question details

C programming only please!

Problem 2 (35 points) Write a program that computes the roots of a quadratic equation ax2 + bx +c 0, which are given by the following formulas and χ2- 2a 2a These formulas cannot be used if the value of a-0, or if the value b2-4ac 0 (complex roots) For the case a-0 and b 0, there is only one root which is For the case a 0 and b - 0, there is no root. For the case b2-4ac < 0, there is no real root. Your program should ask the user to input the coefficients a, b, c of the quadratic equation and display the corresponding solution or appropriate messages. You can use the math library function sqrt(x) to compute the square root of a number x. Examples of Code Execution (users entries in red) Enter the coefficients a, b, c of ax 2 bx c: 00-1.25 your equation has no root Enter the coefficients a, b, c of ax 2 +bx +c: 0-2.5 7.8 One root of -2.50x + 7.80 is 3.120 Enter the coefficients a, b, c of ax*2 +bx +c: 0 4.25 154 One root of 4.25x + 154.00 is -36.235 Enter the coefficients a, b, c of ax 2 +bx + c: 3.5 6 2.4 Roots of 3.50x2 6.00x 2.40 are -0.636 and -1.078 Enter the coefficients a, b, c of ax*2 +bx c: 254 There are no real roots. Enter the coefficients a, b, c of ax*2 +bx +c: 10.75 4.25 0 Roots of 10.75x 2 + 4.25x0.00 are 0.000 and -0.395

Solution by an expert tutor
Blurred Solution
This question has been solved
Subscribe to see this solution