title: C++ while statement not equal checks
body: <p>I started coding in C++ (VS 2015).</p>
  
  <p>Wrote a little program which using a while statement.</p>
  
  <pre><code>#include &lt;iostream&gt;
  
  using namespace std;
  
  int main() {
      int x = 1;
      int y = 2;
      int z = 0;
      while (x != y || z != y) {
          cout &lt;&lt; "x: " &lt;&lt; x &lt;&lt; "\n" &lt;&lt; "z: " &lt;&lt; z &lt;&lt; "\n";
          x++;
          z++;
      }
      cin.get();
  }
  </code></pre>
  
  <p>If i get this correctly it should work in that way (but since its going to an infinite loop i guess my logic is not as correct as i think).</p>
  
  <p>So in my mind the while statement should work in that way.</p>
  
  <p>While X not equal to y OR z not equal to y.</p>
  
  <p>add +1 to X and +1 to Z.</p>
  
  <p>Do this until the statment became true (or atleast the left side of the expression).</p>