title: Changing the if statement into a while statement
body: <p>I'm trying to change an if statement into a while statement.
  For example
  <code>int A=1; if(A==1){};</code>
  is similar to <code>int A=1 while(A!=1)</code>.
  My If statement has no codes, I just need it to do nothing in order to avoid the else-if statements.</p>
  
  <p>My If statement is inside 1 While statement and 1 If statement.
  So I want the program to do the same thing in the while statement rather than going in 1 While statement and 1 If statement with an If statement with no code.</p>
  
  <p>Original codes something like this</p>
  
  <pre><code>while(C1)
  {
      if(C2)
      {
          if( h-&gt;data[temp] &lt; h-&gt;data[temp*2] &amp;&amp; h-&gt;data[temp] &lt; h-&gt;data[temp*2+1] )
          {
               break;
          }
          else if(C4)
          {
              DO();
          }
  
      }
  }
  </code></pre>
  
  <p>I've changed it to</p>
  
  <pre><code>while( C1 &amp;&amp; h-&gt;data[temp] &gt; h-&gt;data[temp*2] &amp;&amp; h-&gt;data[temp] &gt; h-&gt;data[temp*2+1] )
  {
      if(C2)
      {
          if(C4)
          {
              DO();
          }
  
      }
  }
  </code></pre>
  
  <p>and the result is different. The original code gives the correct result but the changed code gives an incorrect result. I've only changed the location to if to while and also changed the direction of the &lt; operator to the > operator.</p>
  
  <p>The total code seems like I've spent less effort in it, making down votes. So I'm posting the code somewhat like a pseudo code.</p>