C Program to find out the roots of a Quadratic Equation and also test for Real and Complex roots. In this example, we will calculate the roots of the quadratic equation by testing for real and complex roots. We can test real and complex roots by checking these conditions : If b 2 −4 ac < 0, then there are no real roots. If b 2 −4 ac = 0, then both the roots are equal. If b 2 −4 ac > 0, then roots are real and distinct. PROGRAM TO FIND OUT THE ROOTS OF A QUADRATIC EQUATION. #include <stdio.h> #include <conio.h> #include <math.h> int main () { int a , b , c , d ; float x , y ; printf ( "Enter coefficient of x^2,x and constant : " ); scanf ( " %d %d %d " ,& a ,& b ,& c ); d = b * b ...
Comments