Algorithm for display roots of a quadratic equation #c
1. Read the value of a , b , c
2. d = b*b - 4*a*c
3. if d < 0 then display The Roots are Imaginary.
else if d = 0
then dispaly Roots are Equal.
r = -b / 2*a
display r
else r1 = -b + √d / 2*a
r2 = -b - √d / 2*a
display Roots are real and r1 , r2
4. Stop
2. d = b*b - 4*a*c
3. if d < 0 then display The Roots are Imaginary.
else if d = 0
then dispaly Roots are Equal.
r = -b / 2*a
display r
else r1 = -b + √d / 2*a
r2 = -b - √d / 2*a
display Roots are real and r1 , r2
4. Stop
Comments
Post a Comment