Write a c program to find the roots of a quadratic equation

int main(){
    int a,b,c;
    double x,y,d;

    printf("Enter a , b , c of quadratic equation: ");

    //calculating the value of d
    d = sqrt(b * b - 4 * a * c);

    //Checking real solution is possible or not
         printf("Real number root is not possible");
    //finding the root of quadractic equation
    x = (-b + d) / 2 * a;
    y = (-b - d) / 2 * a;

    //printing the root of the quadractic equation
    printf("Solution of quadratic equation are %lf , %lf",x,y);

    return 0;


bibhu said...

in gcc compiler(ubuntu 15.03) it is not working

Unknown said...

Help me to solve this,,...

Declare and write a function that changes the value of the passed in argument, so that the caller of the function gets the changes from outside.

Rock said...
This comment has been removed by the author.