Given three angles. The task is to check if it is possible to have a triangle of positive area with these angles. If it is possible print “YES” else print “NO”.
Input : ang1 = 50, ang2 = 60, ang3 = 70 Output : YES Input : ang1 = 50, ang2 = 65, ang3 = 80 Output : NO
Approach: We can form a valid triangle if the below conditions satisfies:
- The sum of the three given angles equals to 180.
- The sum of any two angles is greater than equal to the third one.
- None of the given angles is zero.
Below is the implementation of the above approach:
GeeksforGeeks has prepared a complete interview preparation course with premium videos, theory, practice problems, TA support and many more features. Please refer Placement 100 for details
- Check whether the triangle is valid or not if angles are given
- Find all angles of a triangle in 3D
- Find other two sides and angles of a right angle triangle
- Length of remaining two sides of a Triangle from a given side and its adjacent angles
- Check whether Quadrilateral is valid or not if angles are given
- Area of Reuleaux Triangle
- Program to find area of a triangle
- Find the coordinates of a triangle whose Area = (S / 2)
- Area of Incircle of a Right Angled Triangle
- Area of a triangle inside a parallelogram
- Area of Circumcircle of a Right Angled Triangle
- Area of largest triangle that can be inscribed within a rectangle
- Area of the Largest Triangle inscribed in a Hexagon
- Find the altitude and area of an isosceles triangle
- Area of a largest square fit in a right angle triangle
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to email@example.com. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.
Improved By : Mithun Kumar