Last active
January 2, 2018 13:56
-
-
Save isabolic/efc5a1c1fa581967761f72966774d41f to your computer and use it in GitHub Desktop.
isTriangle
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Heron's Formula | |
| function isTriangle(a,b,c) | |
| { | |
| return (a < (b + c)) && ((a + b) > c) && ((a+c) > b); | |
| } | |
| isTriangle(1,2,2) // => true | |
| isTriangle(7,2,2) // => false | |
| isTriangle(1,2,5) // => false | |
| isTriangle(4,2,3) // => true |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment