#include #include int main () { double a, b, c, D, s; printf("Enter a, b, c: "); scanf("%lf%lf%lf", &a,&b,&c); if (a == 0) { printf("I cannot proceed\n"); return 1; } D = b * b - 4 * a * c; if (D == 0) { printf("One real root %lf", -b / (2 * a)); } else if (D > 0) { s = sqrt(D); printf("Two real roots %lf and %lf\n", (-b+s)/(2*a), (-b-s)/(2*a)); } else { s = sqrt(-D); printf("Two complex roots %lf + i %lf and %lf - i %lf\n", -b/(2*a), s/(2*a), -b/(2*a), s/(2*a)); } return 0; }