Calculate Roots ..?????? (I) A 1 B 2 C 1 (Ii) A 1 B 5 C 2 (Iii) A 2 B 3 C 5

You might also like

Download as doc, pdf, or txt
Download as doc, pdf, or txt
You are on page 1of 1

ALGORITHM TO FIND THE ROOTS OF QUADRATIC

EQUATION
1. START
2. Read the coefcients a, b,c
3. Check a=0
4. Print Equation is not Quadratic, go to ste !
5. Ca"cu"ate discr=#b
$
%&ac'
6. Check discr=0, other!"e #o to "te$ %
Ca"cu"ate root=r(=%b)$a
root$=r$=r(
Print Roots are Rea" and Equa" and #o to
"te$ &
%. Check disc*0, other+ise go to ste ,
root(=r(=%b)$a-sqrt#discr')$a
root$=r$= %b)$a%sqrt#discr')$a
Print Roots are Rea" and distinct #o to "te$
&
'. .ther+ise check #discr'/0, other+ise #o to "te$
&
Ca"cu"ate rea"0art=r(=%b)$a
C"acu"ate i1aginar2
art=r$=sqrt#abs#discr'')$
Print rea"0art-i i1aginar20art
Print rea"0art%i i1aginar20art
Print Roots are Co1"e3 and 41aginar2
&. Sto
Ca"cu"ate roots5555566777777
#i' a=( b=$ c=(
#ii' A=( b=8 c=$
#iii' a=$ b=9 c=8

You might also like