#include #include using namespace std; int main() { int a; int b; int c; double x1; double x2; double term; double a2; cout << " Type in the coefficients a, b and c" << endl; cin >> a >> b >> c; term = b * b - 4.0 * a * c; a2 = a * 2; if ( term < 0.0 ) { cout << " Roots are complex. " << endl; cout << " Calculation abandoned" << endl; } else if ( term > 0.0 ) { term = sqrt(term); x1 = ( -b + term ) / a2; x2 = ( -b - term ) / a2; cout << " Roots are " << x1 << " " << x2 << endl; } else { x1=-b/a2; cout << " Roots are coincedent at " << x1 << endl; } return(0); }