#include <stdio.h>
#include <math.h>
int main() 
{
    int a,b,c,d,e,f;
    float root1, root2;
    printf("\nenter the coefficient of the quadratic equation: ");
    scanf("%d%d%d", &a,&b,&c);
    d=pow(b,2);
    e=4*a*c;
    f=d-e;
    if (f>=0)
    {
        root1 = (-b+sqrt(d-e))/(2*a);
        root2 = (-b-sqrt(d-e))/(2*a);
        printf("%.2f, %.2f",root1, root2);
    }
    else
    {
        printf("\nroots are imaginary");
    }
    return 0;
}

Embed on website

To embed this project on your website, copy the following code and paste it into your website's HTML: