#include <iostream>

#include <cmath>

using namespace std;

int main()

{

// Variable Declerations

double a, b, c;

//Variable Inputs

cout << "Enter the value of a: ";

cin >> a;

cout << "Enter the value of b: ";

cin >> b;

cout << "Enter the value of c: ";

cin >> c;

//Computations

double discriminant = (pow(b,2) - 4*a*c);

double positive_root = (((-b) + sqrt(discriminant))/(2*a));

double negative_root = (((-b) - sqrt(discriminant))/(2*a));

//Output

if (discriminant == 0)

{

cout << "\n\nThe discriminant is ";

cout << discriminant << endl;

cout << "The equation has a single root.\n\n";

}

else if (discriminant < 0)

{

cout << "\n\nThe discriminant is ";

cout << discriminant << endl;

cout << "The equation has two complex roots.\n\n";

}

else

{

cout << "\n\nThe discriminant is ";

cout << discriminant << endl;

cout << "The equation has two real roots.\n\n";

}

//Final Root Values

cout << "The roots of the quadratic equation are x = ";

cout << negative_root;

cout << ", ";

cout << positive_root << endl << endl;

return 0;

}