View Code of Problem 42

#include<stdio.h>
#include<math.h>
int main(){
	float a,b,c,d,e;
	scanf("%f %f %f",&a,&b,&c);
	d=(-b+sqrt(b*b-4.0*a*c))/(2.0*a);
	e=(-b-sqrt(b*b-4.0*a*c))/(2.0*a);
	if(d>e)
	printf("%.2f %.2f",d,e);
	else
	printf("%.2f %.2f",e,d);
}

Double click to view unformatted code.


Back to problem 42