//This program solves quadratic equation
#include<iostream.h>
#include<math.h>
int main()
{
double a,b,c,d;
cout<<"Assuming the equation is of the form aX^2+bX+c=0"<<endl;
cout<<"a = ";cin>>a;
cout<<"b = ";cin>>b;
cout<<"c = ";cin>>c;
d=(b*b)-(4*a*c);
if(d>=0)
{
cout<<"X1 = "<<(-b+sqrt(d))/2;
cout<<"X2 = "<<(-b-sqrt(d))/2;
}
else
{
d=-d;
cout<<"X1 = "<<-b/2<<" + j "<<sqrt(d)/2<<endl;
cout<<"X2 = "<<-b/2<<" - j "<<sqrt(d)/2<<endl;
}
return 0;
}