Created
January 20, 2017 12:36
-
-
Save bflannery/b45dd250ceb8b89bda0f5b8c087b4cda to your computer and use it in GitHub Desktop.
Give 3 integers, will they make a triangle
This file contains 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
// Give 3 integers, will they make a triangle | |
function isTriangle(a,b,c){ | |
if(a+b > c && a+c > b && b+c > a) { | |
return true; | |
} else { | |
return false; | |
} | |
} | |
console.log(isTriangle(1,2,2)); | |
console.log(isTriangle(7,2,2)); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment