Question: Function in C for solving quadratic 6. Write a function that solves a quadratic equation. The function prototype is int quadratic (double a, double b,

Function in C for solving quadratic
 Function in C for solving quadratic 6. Write a function that

6. Write a function that solves a quadratic equation. The function prototype is int quadratic (double a, double b, double c, double *solutionl, double *solution2). The input parameters a, b, and c represent the coefficients of the quadratic equation ax2 + bx + c 0. The output parameters solution 1 and solution2 represent the two solutions. First the function checks whether the equation actually has solutions. The equation has solutions only if b24ac 0. If there are solutions then the function computes the solutions using the formula (-b t (b 4ac))/2a and puts them into the output parameters. If there are no solutions then the function assigns 0 to the output parameters. The function returns true or false depending on whether the equation has solutions or not

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!