#include
#include
/*************************************\
* numRoots(a, b, c) *
\*************************************/
int numRoots(int a, int b, int c)
{
int d = (b * b) - (4 * a * c);
if (d < 0) return 0;
if (d == 0) return 1;
if (d > 0) return 2;
}
/*************************************\
* quadSolve(a, b, c) *
\*************************************/
void quadSolve(int a, int b, int c)
{
double solution1, solution2;
int d = (b * b) - (4 * a * c);
int roots = numRoots(a, b, c);
if (roots == 0) cout<<"There are zero real roots for this function"<<"There is one real root which is: x="<<"There are two real roots which are x="<<"A: ";
cin>>a;
cout<<"B: ";
cin>>b;
cout<<"C: ";
cin>>c;
quadSolve(a, b, c);
}
|