id/email
password
forgot password | create account
about | help | code help+videos | done | prefs
CodingBat code practice

 

canBeTriangle


Given three lengths, return true if a triangle can be created with sides of those lengths. This happens if the largest of the three lengths is smaller than the total of the other two lengths.


canBeTriangle(3, 3, 3) → true
canBeTriangle(5, 13, 12) → true
canBeTriangle(14, 5, 8) → false

...Save, Compile, Run (ctrl-enter)

public boolean canBeTriangle(int a, int b, int c) { }

Editor font size %:
Shorter output


Forget It! -- delete my code for this problem

Progress graphs:
 Your progress graph for this problem
 Random user progress graph for this problem
 Random Epic Progress Graph

Java Help

Misc Code Practice

Difficulty: 170

Copyright Nick Parlante 2017 - privacy