Question: Write a function: void solveQuadratic ( double a , double b , double c , double& x 1 , double& x 2 ) Use the
Write a function:
void solveQuadraticdouble a double b double c double& x double& x
Use the quadratic formula to solve the quadratic equation given by ax bx c You will have to do the math twice once for the version that says b and once for the version that says b
Use x and x to communicate the answers. x should store the result to the version of the formula and x should store the version. If there is only one answer, both xs will be the same. Do not worry about cases with no solution.
Code:
#include
#include
using namespace std;
Any changes above will be ignored
YOURCODEBELOW
YOURCODEABOVE
Any changes below will be ignored
int main
double answer answer;
double in in in;
cin in in in;
solveQuadraticin in in answer answer;
If answer and are still your function did not modify them
cout answer answer endl;
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
