0% found this document useful (0 votes)
32 views

Flowchart Exercise HCMUT

The document contains 9 programming exercises involving conditional logic and basic math operations. Each exercise prompts the user for input, performs calculations, and prints output based on the results. The exercises include determining the largest of 3 numbers, checking if a point is inside a circle, solving quadratic equations, calculating averages, and classifying triangles.

Uploaded by

Nhan Huynh
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
32 views

Flowchart Exercise HCMUT

The document contains 9 programming exercises involving conditional logic and basic math operations. Each exercise prompts the user for input, performs calculations, and prints output based on the results. The exercises include determining the largest of 3 numbers, checking if a point is inside a circle, solving quadratic equations, calculating averages, and classifying triangles.

Uploaded by

Nhan Huynh
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 6

Exercise 4 Start

Input a, b, c

No Yes
a<b b<c

Yes No

No
a<c

Yes

Print: a Print: b Print: c

End
Exercise 5

Start

Input x, y,
x0, y0, r

d = sqrt( (x-x0)^2 + (y-y0)^2 )

No
d == r d<r

Yes

Print: On Print: Inside Print: Outside

End
Exercise 6
Start

Input a, b, c

d = b^2 - 4ac

Yes
d<0

No

No
x1= (-b + sqrt(d)) / (2a)
d == 0
x2 = (-b - sqrt(d)) / (2a)

Yes

x = -b / (2a)

Print: No solution Print: x Print: x1, x2

End
Exercise 7

Start

Input N

i=0
sum = 0

Input temp

sum += temp
i++

Yes
i<N

No

avg = sum / N

Print: avg

End
Exercise 8

Start

Input a, b, c

isosceles = 0

Yes a == b or No
b == c or
c == a

No a^2 == b^2 + c^2 No


a == b
isosceles = 1 || b^2 == a^2 + c^2
and a == c
|| c^2 == a^2 + b^2

Yes

Yes

Yes
isosceles = 1

No

Print: isosceles
Print: equilateral Print: right - angled Print: Normal
right - angled

End
Exercise 9
Start

Input a, b, c, d

avg = (a+b+c+d) / 4

No
avg >= 60

Yes

Print: Pass Print: Fail

End

You might also like