Computer scienceAlgorithms and Data StructuresIntro to algorithms and data structuresPseudocode and representation

Relations and conditions in pseudocode

Check triangle

Report a typo

Create pseudocode that checks the type of triangle with given sides and stores the result in the type variable. Сonsider variables a, b, and c, containing the sides of the triangle, to be already declared.

Tip: Remember to indent correctly. It helps organize your pseudocode and ensures you correctly identify and store the triangle type based on the given sides.
Reorder lines using drag or arrows. Adjust indentation with left buttons
                else:
              
                type = "scalene"
              
                if a == b and b == c and a == c then:
              
                type = "isosceles"
              
                type = "equilateral"
              
                elif a == b or b == c or a == c then:
              
___

Create a free account to access the full topic