How to solve the unary Quadratic equation in C language
This article introduces the relevant knowledge of "how to solve the univariate quadratic equation in C language". In the operation of practical cases, many people will encounter such a dilemma, so let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!
Find the unary quadratic equation: the root of ax2+bx+c=0.
Enter three values of the real number a _ r _ b ~ c, and an is not equal to 0.
Example
# include
# include
Int main () {
Float a,b,c,x1,x2,d
Printf ("three coefficients of input equation:")
Scanf ("% f% f% f", & a)
If (aversion 0)
{
D=sqrt (b*b-4*a*c)
X1 = (- breadd) / (2profa)
X2 = (- bmurd) / (2yoga)
If (x1)