#include<math.h>
#include<iostream.h>
#include<conio.h>
#include<process.h>
class quadratic
{
private:
double a,b,c;
public:
void read();
void funcroots();
};
void quadratic::read()
{
cout<<"Enter coffiecients of Quadratic Eq. a,b,c";
cin>>a>>b>>c;
}
void quadratic::funcroots()
{
if(a==0)
{
cout<<"\nEquations is not quadratic";
exit(0);
}
else
{
double disc;
disc=b*b-4 *a*c;
if(disc<0)
cout<<"\nRoots are Imaginary";
else if(disc==0)
{
double x=-b/(2*a);
cout<<"\nRoots are Equal,x= u"<<x;
}
else
{
double m,n,t;
t=sqrt(disc);
m=( -b+t)/(2*a);
n=(-b-t)/(2*a);
cout<<"\nRoots are Real and Unequal"<<endl;
cout<<"m="<<m<<endl;
cout<<"n="<<n;
}
}
}
void main()
{
clrscr();
quadratic q1 ;
q1.read();
q1.funcroots();
getch();
}