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

NAME: OMOKHAIYE PRECIOUS OHIMAI

MATRIC NO: 19CK025906

PROGRAM: EEE

COURSE: EEE515

ASSIGNMENT

Draw a flowchart to find the real roots of the equation a x 2 +bx +c=0 where a, b, c are real using the equation.

−b+ √ b2 −4 ac −b−√b 2−4 ac


x 1= , x 2= for ten sets of values a, b, c
2a 2a

SOLUTION

1. Start
2. Initialize n=0
3. Increment n by 1 and assign value to n
4. Input values a n , b n , c n
5. Read values a n , b n , c n
2
6. Compute d=bn−4 a n cn
7. If d >0 then ,
−b+ √ d
x n 1=
2a
−b− √ d
x n 2=
2a
print x n1 , x n2 . values

8. else if d=0 then ,


−b
x n 1=
2a
−b
x n 2=
2a
print x n1 , x n2 . values

9. else if d< 0
Print roots are Imaginary
10. If n=10 then
STOP
else go ¿ step3
FLOWCHART

START

n=0

n=n+1

Input values for


an , bn , cn

Read values for


an , bn , cn

2
Compute d=bn−4 a n c n

TRUE FALSE
Is d> 0

FALSE TRUE
Is d=0
Compute

−b+ √ d
x n 1=
2a Print roots are Compute
−b− √ d imaginary −b
x n 2= x n 1=
2a 2a
−b
x n 2=
2a
Print x n 1 , x n 2

Print x n 1 , x n 2

NO
Is n=10
YES

Stop

You might also like