Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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
image text in transcribed
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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Introduction To Data Mining

Authors: Pang Ning Tan, Michael Steinbach, Vipin Kumar

1st Edition

321321367, 978-0321321367

More Books

Students also viewed these Databases questions