C Sample Program : Solving Quadratic Equation. This program receives the coefficient of a quadratic equation and calculates output
#include <stdio.h> #include<stdlib.h> #include <math.h> /*d for discriminant*/"\nInput values of a, b, and c\n"); 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", root1,root2 ); } }