Write a program to print roots of a quadratic equation
Answers
Answered by
1
Answer:
Program to Find Roots of a Quadratic Equation
#include <math.h>
double a, b, c, discriminant, root1, root2, realPart, imagPart;
printf("Enter coefficients a, b and c: ");
scanf("%lf %lf %lf", &a, &b, &c);
discriminant = b * b - 4 * a * c;
// condition for real and different roots.
if (discriminant > 0)
Similar questions