1.

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

Answer»

k 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