QUADRATIC EQUATION

#include<stdio.h>
#include<math.h>
void main()
{
float a,b,c,x,y,p,q;
printf("assume the equation ax^2 + bx+c=0\n");
printf("enter the a part of equation\n");
scanf("%f",&a);
printf("enter the b part of equation\n");
scanf("%f",&b);
printf("enter the c part of equation\n");
scanf("%f",&c);
p=(b*b)-(4*a*c);
if(p<0)
{
printf("the roots are imaginary\n");
exit(1);
}
else
q=sqrt(p);

x=((-b)+q)/(2*a);
y=((-b)-q)/(2*a);
printf("The roots are\n %f\n %f\n ",x,y);
}