Here you will get C program to find roots of quadratic equation ax2+bx+c=0 #include<stdio.h> #include<math.h> int main() { float root1,root2,a,b,c,d,imaginaryPart,realPart; printf(“Quadratic Equation is ax^2+bx+c=0”); printf(“\nEnter values of a,b and c:”); scanf(“%f%f%f”,&a,&b,&c); d=(b*b)-(4*a*c); if(d>0) { printf(“\nTwo real and distinct roots”); root1=(-b+sqrt(d))/(2*a); root2=(-b-sqrt(d))/(2*a); printf(“\nRoots are %f and %f”,root1,root2); } else if(d==0) { printf(“\nTwo real and equal roots”); root1=root2=-b/(2*a); …
C Program to Find Roots of Quadratic Equation Read More »