Saturday 7 August 2010

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












#include


#include

int main(){

    int a,b,c;

    double x,y,d;



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

    scanf("%d%d%d",&a,&b,&c);



    //calculating
the value of d

    d
= sqrt(b * b - 4 * a * c);



    //Checking
real solution is possible or not

    if(d<0){

         printf("Real
number root is not possible");

         exit(1);

    }

No comments:

Post a Comment