Check whether the triangle is valid or not if angles are given | Function to check if sum of the three angles is 180 or not ; check condition ; Driver Code ; function calling and print output
function Valid ( a , b , c ) { if ( a + b + c == 180 && a != 0 && b != 0 && c != 0 ) return 1 ; else return 0 ; } var a = 60 , b = 40 , c = 80 ; if ( ( Valid ( a , b , c ) ) == 1 ) { document . write ( " " ) ; } else { document . write ( " " ) ; }