 <p>I believe this is a better alternative if you're optimizing for speed:</p> <pre><code>int n = 5; for(int i = n;i &gt; 0;i--) { //executing 5times } </code></pre> <p>The reason for that is that comparing with 0 is faster.</p>