#include <stdio.h>
#include<math.h>
int main()
{
float a, b, c, D, x1, x2;
printf("Enter the coefficiants :\n");
scanf("%f %f %f", &a, &b, &c);
D = (b * b) - (4 * a * c);
x1 = (-b + sqrt(D)) / 2 * a;
x2 = (-b - sqrt(D)) / 2 * a;
printf("The roots of the quadratic equation are :\t%.3f\t%.3f", x1, x2);
return 0;
}
No comments:
Post a Comment