title: C++ infinite loop based on input
body: <pre><code> #include &lt;iostream&gt;
   using namespace std;
  
   int main (){   
      
      unsigned int x{0};
      unsigned int y{0};
      unsigned int i{1};
      unsigned int power{1}; 
  
      cout&lt;&lt;&quot;Input x and y: &quot;&lt;&lt;endl;
      cin &gt;&gt;x;
      cin &gt;&gt;y;
  
      while (i&lt;y || i == y)
      {
          power *= x;
          ++i;
          cout &lt;&lt; power &lt;&lt;endl;
      }
      
  
   }
  </code></pre>
  <p>output:</p>
  <pre><code>Input x and y: 
  10
  5
  10
  5
  10
  5
  </code></pre>
  <p>and it would keep running to infinity, but if I remove the = condition it runs, why is that happening.</p>