Question: C PROGRAMMING!! Need help with a program triangles.c that reads in the lengths of the three sides of a triangle. First, verify that the lengths
C PROGRAMMING!!
Need help with a program triangles.c that reads in the lengths of the three sides of a triangle. First, verify that the lengths do form a triangle: adding any two sides should yield a number that exceeds the third. Next, if it is a triangle, determine if the triangle is equilateral: all sides would have equal length; determine if the triangle is isosceles: two sides have equal length, which is different from the third. Finally, determine if the triangle is right-angled: the sum of the square of two sides would yield the square of the third.
Example input/output:
Enter the lengths of three sides of the triangle: 3.3 19.6 3.3
Output: The three sides do not form a triangle.
Enter the lengths of three sides of the triangle: 3.3 3.3 3.3
Output: The three sides form a triangle. The triangle is equilateral.
Enter the lengths of three sides of the triangle: 3 4 5
Output: The three sides form a triangle. The triangle is right-angled.
Enter the lengths of three sides of the triangle: 6.3 6.3 5
Output: The three sides form a triangle. The triangle is isosceles.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
