Check if a triangle of positive area is possible with the given angles | Java program to check if a triangle of positive area is possible with the given angles ; Checking if the sum of three angles is 180 and none of the angles is zero ; Checking if sum of any two angles is greater than equal to the third one ; Driver Code
class GFG { static String isTriangleExists ( int a , int b , int c ) { if ( a != 0 && b != 0 && c != 0 && ( a + b + c ) == 180 ) if ( ( a + b ) >= c || ( b + c ) >= a || ( a + c ) >= b ) return " YES " ; else return " NO " ; else return " NO " ; } public static void main ( String [ ] args ) { int a = 50 , b = 60 , c = 70 ; System . out . println ( isTriangleExists ( a , b , c ) ) ; } }