Source Code :
#include<stdio.h>
#include<math.h>
void main()
{
float a,b,c,dd,d,x,y;
clrscr();
printf("Enter the Values of a,b,c of a Quadratic Equation : ");
scanf("%f %f %f",&a,&b,&c);
if(a!=0)
{
dd=(b*b)-(4*a*c);
if(dd<0)
{
printf("\n\n\t\tThe Roots are Imaginary");
dd=-dd;
d=sqrt(dd);
x=(-b+d)/(2*a);
y=(-1)*(-b-d)/(2*a);
printf("\n\nThe two roots of the Quadratic Equation are :
x=%5.2f(i) and y=%5.2f(i)",x,y);
}