Solving Quadratic Equation

C Sample Program : Solving Quadratic Equation. This program receives the coefficient of a quadratic equation and calculates output

  1. #include <stdio.h>
  2. #include<stdlib.h>
  3. #include <math.h>
  4. /*d for discriminant*/"\nInput values of a, b, and c\n");
  5. scanf("%f %f %f""\n\nROOTS ARE IMAGINARY\n""\nThe Real part Root1 = %5.2f""\nThe imaginary part Root2 = %5.2f""\n THE ROOTS ARE REAL AND EQUAL""\n Root1 = %f\n Root2 = %f""The ROOTS ARE REAL AND UNEQUAL \n""\n\nRoot1 = %5.2f\n\nRoot2 = %5.2f\n",
  6. root1,root2 );
  7. }
  8.  
  9. }