#include #include int main() { float a, b, c, d; float root1, root2; printf("Enter the coefficients of a quadratic equation:\n"); printf("ax^2 + bx + c = 0 --> "); scanf("%f %f %f", &a, &b, &c); d = b * b - 4 * a * c; if (a == 0) { if (b == 0) printf("It is not an equation\n"); else { root1 = -c / b; printf("Root of the linear equation = %.2f\n", root1); } } else { if (d < 0) printf("No real root.\n"); else if (d == 0) { root1 = -b / (2 * a); printf("The double root = %.2f\n", root1); } else { root1 = (-b + sqrt(d)) / (2 * a); root2 = (-b - sqrt(d)) / (2 * a); printf("The unequal roots are %.2f and %.2f\n", root1, root2); } } return 0; }