1.

Write a function that takes the lengths of three sides: side1, side2 and side3 of thetriangle as the input from the user using input function and return the area of thetriangle as the output. Also, assert that sum of the length of any two sides is greaterthan the third side.

Answer»

Check whether triangle is valid or not if sides are given

Given three sides, check whether triangle is valid or not.

Examples:

Input : a = 7, b = 10, c = 5

OUTPUT : Valid

Input : a = 1 b = 10 c = 12

Output : Invalid

Recommended: PLEASE try your approach on {IDE} first, before moving on to the solution.

Approach: A triangle is valid if sum of its two sides is greater than the third side. If three sides are a, b and c, then three CONDITIONS should be MET.



Discussion

No Comment Found