#include<iostream.h>
#include<math.h>
#include<conio.h>
void main()
{
float a,b,c,root1,root2,delta;
cout<<"\n\t Enter three numbers a, b, & c of ax^2+bx+c:\n";
cin>>a>>b>>c;
if(!a) // if a is zero
cout<<"\n\t Value of \'a\' should not be zero"<<"\n\t Aborting!!"<<"\n";
else
{
delta=b*b-4*a*c; // beginning of else's body
if(delta>0)
{
root1=(-b+sqrt(delta))/(2*a);
root2=(-b-sqrt(delta))/(2*a);
cout<<"\n\t Roots are REAL and UNEQUAL"<<"\n";
cout<<"Root1="<<root1<<"\t"<<"Root2="<<root2<<"\n";
}
else
cout<<"\n\t Roots are COMPLEX and IMAGINARY"<<"\n";
} //end of else's body.
getch();
}