Wed, Apr 26, 2017, 12:57:47 PM
by zhimin

#include <stdio.h>
#include <math.h>
int main()
{
double a,b,c,disc,p,q,x1,x2;
scanf("%lf%lf%lf",&a,&b,&c);

disc=b*b-4*a*c;
p=-b/(2.0*a);
q=sqrt(disc)/(2.0*a);
x1=p+q;
x2=p-q;

printf("x1=%7.2f
x2=%7.2f",x1,x2);
return 0;
}

Wed, Apr 26, 2017, 12:53:29 PM
by zhimin

#include <stdio.h>
#include <math.h>
int main()
{
double a,b,c,disc,p,q,x1,x2;
scanf("%lf%lf%lf",&a,&b,&c);

disc=b*b-4*a*c;
p=-b/(2.0*a);
q=sqrt(disc)/(2.0*a);
x1=p+q;
x2=p-q;

printf("x1=%7.2f
x2=%7.2f",x1,x2);
return 0;
}

...............