Write a C program to calculate the value of x in the quadratic equation.

𝑎𝑥
2 + 𝑏𝑥
+ 𝑐 = 0
Where 𝑥 =
−𝑏±√𝑏2−4𝑎𝑐
2𝑎
Implement using the following conditions.
If 𝑏
2 − 4𝑎𝑐 = 0 then Equation has two equal values.
If 𝑏
2 − 4𝑎𝑐 > 0 then Equation has two distinct values.
If 𝑏
2 − 4𝑎𝑐 < 0 then Equation has no roots.

2 answers

looks like you just need to review basic C syntax for math calculations.
There are many examples online

and, when typing online, use ^ for exponents, as in b^2, rather than
b2 or b
2
Write a C program to calculate the value of x in the quadratic equation.
𝑎𝑥
2 + 𝑏𝑥
+ 𝑐 = 0
Where 𝑥 =
−𝑏±√𝑏2−4𝑎𝑐
2𝑎
Implement using the following conditions.
If 𝑏
2 − 4𝑎𝑐 = 0 then Equation has two equal values.
If 𝑏
2 − 4𝑎𝑐 > 0 then Equation has two distinct values.
If 𝑏
2 − 4𝑎𝑐 < 0 then Equation has no roots.