Question: wrote in c 6. Write a function that solves a quadratic equation. The function prototype is int quadratic (double a, double b, double c, double

wrote in c
wrote in c 6. Write a function that solves a quadratic equation.

6. Write a function that solves a quadratic equation. The function prototype is int quadratic (double a, double b, double c, double solutioni, double *solution2). The input parameters a, b, and c represent the coefficients of the quadratic equation ax? + bx + c = 0. The output parameters solution and solution2 represent the two solutions. First the function checks whether the equation actually has solutions. The equation has solutions only if b2 - 4ac 20. If there are solutions then the function computes the solutions using the formula (-b I V(62 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. 7. Write a recursive function that computes the factorial of a number. The factorial of a number n is the product 1.2.3.4...n of the first n positive integers. The function prototype is int factorial (int n). The function computes the factorial of n and returns it. The function must be recursive and loops should not be used

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!