View Code of Problem 42

#include <stdio.h>
#include <math.h>
int main()
{  
	int a,b,c,n;
	float m,p,q;
	scanf("%d %d %d",&a,&b,&c);
	n=b*b-4*a*c;
	m=sqrt(n);
	p=(-b*1.0)/(2*a);
	q=1.0*m/2*a;
	printf("%.2f %.2f\n",p+q,p-q);
	return 0;
}

Double click to view unformatted code.


Back to problem 42