using namespace std;
int main() {float a, b, c;cout << "Enter coefficients a, b and c: ";cin >> a >> b >> c;
}
using namespace std;
int main() {
float discriminant = b * b - 4 * a * c;float a, b, c;
cout << "Enter coefficients a, b and c: ";
cin >> a >> b >> c;
if (discriminant > 0) {
float root1 = (-b + sqrt(discriminant)) / (2 * a);
float root2 = (-b - sqrt(discriminant)) / (2 * a);
cout << "Roots are real and different." << endl;
cout << "Root 1 = " << root1 << endl;
cout << "Root 2 = " << root2 << endl;
} else if (discriminant == 0) {
float root = -b / (2 * a);
cout << "Roots are real and same." << endl;
cout << "Root = " << root << endl;
} else {
float realPart = -b / (2 * a);
float imaginaryPart = sqrt(-discriminant) / (2 * a);
cout << "Roots are complex and different." << endl;
cout << "Root 1 = " << realPart << " + " << imaginaryPart << "i" << endl;
cout << "Root 2 = " << realPart << " - " << imaginaryPart << "i" << endl;
}
return 0;
}