title: Program to determine if 3 sides form a valid triangle using Java
body: <p>Given three integers a, b, and c, return true if a, b, and c could be the lengths of the sides of a right triangle. Return false otherwise. Recall that in a right triangle, each side must have a positive length, and the sum of the squares of the leg lengths must equal the square of the length of the hypotenuse.</p>
  
  <p>isRightTriangle(3, 4, 5) → true
  isRightTriangle(4, 3, 5) → true
  isRightTriangle(5, 4, 3) → true</p>
  
  <pre><code>boolean isRightTriangle(int a, int b, int c) {
    if(a&gt;0 &amp;&amp; b&gt;0 &amp;&amp; c&gt;0){
      if((Math.sqrt((double)a)+Math.sqrt((double)b))==Math.sqrt((double)c)){
        return true;
      }
      else{
        if((Math.sqrt((double)b)+Math.sqrt((double)c))==Math.sqrt((double)a)){
          return true;
        }
        else{
          if((Math.sqrt(c)+Math.sqrt(b))==Math.sqrt(a)){
            return true;
          }
          else{
            return false;
          }
        }
      }
      }
    else{
      return false;
    }
  }
  </code></pre>