Get the App
SLTechnology News&Howtos  ›  Development  › 

How to solve the unary Quadratic equation in C language

Shulou Source: shulou.com Published: 2022-06-01 01:50:54 10月04日 Update

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)

Tags: Unary quadratic equation three input language content equation more knowledge coefficient practicality achievement and then dilemma example real number reality situation article case result Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Linux MariaDB Docker NVidia Shulou Technology