// Arup Guha
// 10/8/2011
// Program that solves the quadratic equation, correcting quadratic-bug.c.
// Note: Only works for equations with real roots!!!

#include <stdio.h>
#include <math.h>

int main() {

    double a, b, c;

    printf("Enter a, b, c from your quadratic equation.\n");
    scanf("%lf%lf%lf", &a, &b, &c);

    double x1 = (-b + sqrt(pow(b,2) - 4*a*c))/(2*a);
    double x2 = (-b - sqrt(pow(b,2) - 4*a*c))/(2*a);

    printf("Your roots are %lf and %lf.\n", x1, x2);

    return 0;
}
