KnowledgeBoat Logo

Computer Applications

Write algorithms and draw flowcharts for the following:

Accept three numbers and check whether they are 'Pythagorean Triplets' or not. Display the message accordingly.
(Hint: Use Pythagoras Formula for a Right-angled Triangle: h = p2+b2)

Algo & Flowcharts

203 Likes

Answer

Algorithm

Step 1: Start
Step 2: Take 3 numbers as input (Say A,B,C)
Step 3: If A2 = B2 + C2, display 'Pythagorean Triplets'
Step 4: If B2 = A2 + C2, display 'Pythagorean Triplets'
Step 5: If C2 = A2 + B2, display 'Pythagorean Triplets'
Step 6: If no condition of Step 3,4,5 match, display 'Not Pythagorean Triplets'
Step 7: Stop

Flowchart

Flowchart to accept three numbers and check whether they are Pythagorean Triplets or not. Display the message accordingly. Algorithms and Flowcharts, APC Understanding Computer Studies Solutions ICSE Class 8.

Answered By

133 Likes


Related Questions