URI Online Judge Solution| 1036 Bhaskara’s Formula

An equation ax2 + bx + c = 0 where a,b and c are any number  and called the coefficient of the equation
It is known as quadratic equation because any seconbd degree polynomial equation is known as quadratic equation.This equation has two roots x1 and x2

This is Bhaskara’s Formula or Bhaskaracharya’s Formula where discriminant D or Del = b24ac
If D>0 then root of quadratic equation are real and unequal
If D=0 then root of quadratic equation are real and equal
If D<0 then root of quadratic equation are conjugate complex number

So my code is here

int main()
double a,b,c,r1,r2,d;
scanf("%lf %lf %lf",&a,&b,&c);
if(a!=0 && d>0)
    printf("R1 = %.5lf\nR2 = %.5lf\n",r1,r2);
    printf("Impossivel calcular\n");

return 0;


It would be a great help, if you support by sharing :)
Author: zakilive

Leave a Reply

Your email address will not be published. Required fields are marked *