// HIDE_START // vim: ts=4 sw=4 et #include #include int main(void) { // HIDE_END float a, b, c, d; printf("please input a, b and c:\n"); scanf("%f %f %f", &a, &b, &c); d = (b * b) - (4 * a * c); if (d < 0) { // Both solutions are imaginary numbers. printf("no real solutions\n"); } else { float soln1, soln2; soln1 = (-b + sqrt(d))/(2 * a); soln2 = (-b - sqrt(d))/(2 * a); printf("solutions: %f and %f\n", soln1, soln2); } // HIDE_START return 0; } // HIDE_END