title: What is difference between while(++i < --j) & while(i++<j--)?
body: <p>I try this below program which find midpoint between two no.</p>
  
  <pre><code>class FindMidPoint
  
  {
  
  public static void main(String args[])
  
  {
  
  int i, j;
  
  i = 100;
  
  j = 200;
  
  
  // find midpoint between i and j
  
  while(++i &lt; --j) ;
  
  System.out.println("Midpoint is " + i+" OR "+j);
  
  }
  
  }
  </code></pre>
  
  <p>Output:</p>
  
  <pre><code>Midpoint is 150 OR 150
  
  But If I make changing in while condition that is
  
  while(i++&lt;j--)
  
  Then output is:
  
  Midpoint is 16 OR 14
  </code></pre>
  
  <p>I also refer the below Link then also I'm not understanding the difference between ++i &amp; i++ in this program.</p>
  
  <p><a href="https://stackoverflow.com/questions/2315705/what-is-the-difference-between-i-i-in-for-loop-java">what is the difference between i++ &amp; ++i in for loop (Java)?</a></p>
  
  <p>Please explain me if anyone have idea about.</p>