Read in the lengths of the sides of a triangle and determinewhether the triangle
ID: 3611041 • Letter: R
Question
Read in the lengths of the sides of a triangle and determinewhether the triangle is an isosceles triangle (two sides areequal), an equilateral triangle (three sides are equal), or ascalene triangle (no sides are equal). The lengths of the sides ofthe triangle are to be entered as integer values. For each set ofsides, print out the kind of triangle or an error message sayingthat the three sides do not make a triangle. (For a triangle toexist, any two sides together must be longer than the remainingside.) Continue analyzing triangles until end-of-file occurs.
Explanation / Answer
#include#include #include using namespace std;bool is_triangle(int *arr){int s1,s2,s3;s1=arr[0];s2=arr[1];s3=arr[2];coutRelated Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.