I’m doing a task where the user enters three sides of a triangle to calculate the base area and the circumference. I have to uppdate my code because it was not accepted by the teacher. I must do some kind of check to make sure the values make a valid triangle. I search and found some info about Triangle Inequality Theorem and it’s about The sum of the lengths of any two sides of a triangle is greater than the length of the third side
So if I’m getting this right, I have the values A, B and C and I’m going to sum A + B to check if this is greater than C and sum A + C it this is greater than B and finally check if the sum of B + C is greater than A before a calculation is done. Is this correct? Help is preciated!
Your approach summing up the lengths of two sides and comparing them to the third side is correct, but you must do so for every pair of lines.
Only if all three of these are true, you have a triangle.