title: method that returns the sum of the odd integers from 1 to n (inclusive)?
body: <p>This is what I have got but it doesn't work. When I try to compile I get this error message: </p>
  
  <blockquote>
    <p><code>int result = 0;</code><br>
    <code>^^^^^^^^^^^^^^^</code><br>
    Unreachable code  </p>
  </blockquote>
  
  <p>My code:</p>
  
  <pre><code>public int sumOfOddIntegers (int n) {
  
      if(n &lt; 1);
      return 0;
  
      int result = 0;
      for(int i = n - 1; i &gt; 0; i--)
      {
          if(i % 2 != 0) {
              result = result + i;
         }
      }
      return result;
  }
  </code></pre>