title: Why is one for-loop working as wished but the other not iterating?
body: <p>Here two somehow similar problems (1.-Sum of uneven numbers until n; 2.-Sum of the series 1/n) to be solved using for-loops.
  I chose the shown strategy and while for the 1st problem my loop works as expected, for the 2nd it does not iterate.
  I can't see the difference to understand what is wrong in the last case.</p>
  <p>----1----- :</p>
  <pre><code>int main()
  {
   // Example: Input=5, Output=1+3+5=9
  int  i, lastNum ,sumUneven;
   printf(&quot;Until what n should the uneven numbers be added: &quot;);
   scanf(&quot;%d&quot;, &amp;lastNum);
   sumUneven=0;
  
    for (i=1; 2*i-1&lt;=lastNum; i++) {
       sumUneven=sumUneven + (2*i-1);
    }
    
    printf(&quot;Sum of uneven numbers until %d: %d&quot;, lastNum, sumUneven);
  }
  </code></pre>
  <p>----2------------:</p>
  <pre><code>int main()
  {
      //My goal: Input=n; Output= 1+ 1/2 + 1/3....+1/n.
      
      int i, n, sum;
      
    printf(&quot;Until what n should this series be calculated: &quot;);
  
   scanf(&quot;%d&quot;, &amp;n);
   sum=0;
  
    for (i=1; i&lt;=n; i++) {
       sum = sum + 1/i;
    }
    
    printf(&quot;Sum of the series until 1/%d: %d&quot;, n, sum);
  }
  </code></pre>