0% found this document useful (0 votes)
14 views1 page

Python Decision 4

This document provides instructions for finding all roots of a quadratic equation ax^2 + bx + c = 0. It describes reading in the coefficients a, b, c and calculating the discriminant D. It then provides the logic to determine if there are 0, 1 or 2 real roots and outputs the appropriate root(s).
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
14 views1 page

Python Decision 4

This document provides instructions for finding all roots of a quadratic equation ax^2 + bx + c = 0. It describes reading in the coefficients a, b, c and calculating the discriminant D. It then provides the logic to determine if there are 0, 1 or 2 real roots and outputs the appropriate root(s).
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 1

FIND ALL ROOTS OF A QUADRATIC EQUATION ax 2+bx+c=0

START

READ ax2+bx+c=0

D=(B2-4AC)0.5

FALSE FALSE
X= ( -B +i*(B2-4*A*C)0.5)/(2*A)
D==0 D>0
Y=(-B-i*(B2-4*A*C)0.5)/(2*A)

TRUE TRUE

X=-B/(2*A) X= (-B+ (B2-4*A*C) 0.5)/(2*A)


PRINT X Y
Y=X 2
Y= (-B-(B -4*A*C) 0.5
)/(2*A)

PRINT X Y PRINT X Y

STOP

You might also like