View Code of Problem 42

#include <stdio.h>
#include <math.h>
int main(int argc, char *argv[])
{
	double x,y,a,b,c,sum,sum1;
	int n,i;
	while(scanf("%lf %lf %lf",&a,&b,&c)!=EOF)
	{
		sum=(-b+sqrt(b*b-4*a*c))/(2*a);
		sum1=(-b-sqrt(b*b-4*a*c))/(2*a);
		printf("%.2lf %.2lf\n",sum,sum1);
	}
	return 0;
}

Double click to view unformatted code.


Back to problem 42