/* Program to Calculate Quadratic Equation */
#include "stdio.h"
#include "math.h"
#include "conio.h"
main()
{
	float a,b,c,root1,root2,discriminant;
	clrscr();
	printf("Enter the values of a,b,c\n");
	scanf("%f %f %f",&a,&b,&c);
	discriminant= pow (b,2) - 4*a*c;
	if (discriminant < 0)
		printf("roots are imaginary\n");
	else if (discriminant == 0)
		printf("roots are equal");
	else if (discriminant > 0)
	{
		root1= -b + sqrt (discriminant)/(2.0 * a);
		root2= -b - sqrt (discriminant)/(2.0 * a);
		printf("\n Root1= %5.2f\n",root1);
		printf("\n Root2= %5.2f\n",root2);
	}
	getch();
}
/* Note : input values of a,b,c : 3 2 4   output: roots are imaginary
	  input values of a,b,c : 0 0 0   output: roots are equal
	  input values of a,b,c : 2 3 -17 output: root1=0.01 root2=-6.01
*/