Skip to content

Instantly share code, notes, and snippets.

@bflannery
Created January 20, 2017 12:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bflannery/b45dd250ceb8b89bda0f5b8c087b4cda to your computer and use it in GitHub Desktop.
Save bflannery/b45dd250ceb8b89bda0f5b8c087b4cda to your computer and use it in GitHub Desktop.
Give 3 integers, will they make a triangle
// 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