title: Find biggest value in C using overflow and loop
body: <p>The task is to find the biggest int value with a loop. I have the exact same code almost
  in C and in Java. In Java it works fine, but in C I get the smallest value instead and
  I would like to know why.</p>
  <p><strong>C</strong></p>
  <pre class="lang-c prettyprint-override"><code>#include &lt;stdio.h&gt;
  int main() {
      int i = 0;
      for (; i+1 &gt; 0; i++) { }
      printf(&quot;%d&quot;, i);
      return 0;
  }
  </code></pre>
  <p><strong>Java</strong></p>
  <pre class="lang-java prettyprint-override"><code>public class Java {
      public static void main(String[] args) {
          int i = 0;
          for (; i+1 &gt; 0; i++) { }
          System.out.println(i);
      }
  }
  </code></pre>