title: For loop different end conditions in the same line?
body: <p>Suppose you want to loop <code>from i=0 to i=n and j=0 to j=m</code> and that <code>m!=n</code>. Is it possible to shorten the following two loops into one?</p>
  
  <pre><code>for(int i=0; i&lt;=n; i++){}
  for(int j=0; j&lt;=m; j++){}
  </code></pre>
  
  <p>To something along</p>
  
  <pre><code>for(int i=0,j=0; i&lt;=n, j&lt;=m; i++, j++){}
  </code></pre>
  
  <p>In essence I want the loop to say "increment both i and j by one, stop incrementing i if i=n but keep incrementing j if m>n" or the other way around if <code>n&gt;m</code>.</p>
  
  <p>May seem trivial or stupid but I am curious.</p>