title: writing a function that takes int n and returns the sum of odd less than n
body: <p>Here is my code</p>
  
  <pre><code>public static int sumOfOddLessThan(int n)
  {
      int iResult = 0;
      for(int i = n - 1; i &gt; 0 &amp;&amp; i % 2 != 0; i--)
      {
          iResult = iResult + i;
      }
      return iResult;
  }
  </code></pre>
  
  <p>It does not work correctly, I dunno why :\</p>
  
  <p>It should return 4 when I enter 5 but it returns 0</p>