- Home
- Algorithms & Flowcharts for ICSE Computers
Write algorithm to input three sides of a triangle and print
Algorithms & Flowcharts for ICSE Computers
Write algorithm to input three sides of a triangle and print if it is scalene, isosceles or equilateral.
Answer
Algorithm
Step 1: Start
Step 2: Read three sides of triangle and store them in a, b, c.
Step 3: Check if a == b and b == c
Step 4: If true, print "Equilateral Triangle" and goto step 8
Step 5: Check if a == b or b == c or c == a
Step 6: If true, print "Isosceles Triangle" and goto step 8
Step 7: Print "Scalene Triangle"
Step 8: Stop