//ENTER COEFFICIENTS OF A QUADRATIC EQUATION AND DISPLAY THE ROOTS
//OF THE EQUATION ALONG WITH THEIR NATURE
#include<iostream.h>
#include<conio.h>
#include<math.h>
void main()
{
	clrscr();
	int a,b,c,D;
	float root1,root2;
	cout<<"Enter the coefficients of the equation:";
	cin>>a;
	cin>>b;
	cin>>c;
	D=b*b-4*a*c;
	if(D>0)
	{
		cout<<"\n real and distinct roots";
		root1=(-b+sqrt(D))/(2*a);
		root2=(-b-sqrt(D))/(2*a);
		cout<<"roots are\n"<<root1<<'\t'<<root2;
	}
	else
	if(D==0)
	{
		cout<<"\n real and equal roots";
		root1=(-b)/(2*a);
		root2=(-b)/(2*a);
		cout<<"roots are\n"<<root1<<'\t'<< root2;
	}
	else
	if(D<0)
	{
		cout<<"imaginary roots\n";
	}
	getch();
}

        

