title: negative value input in while loop c++
body: <p>I have this code:</p>
  
  <pre><code>double i;
  while(cin &gt;&gt; i)
  {
      if ( i &lt; 0.0)
          cout &lt;&lt; "ENTER A POSITIVE NUMBER: ";
      else
          break;
  }
  </code></pre>
  
  <p>I want code like this ( I don't want to use break):</p>
  
  <pre><code>while((cin &gt;&gt; i) &lt; 0.0)
  {
      cout &lt;&lt; "ENTER A POSITIVE NUMBER: ";
  }
  </code></pre>
  
  <p>I get an error on this line: <code>while((cin &gt;&gt; i) &lt; 0.0)</code> saying <code>invalid operands to binary expression</code>.</p>
  
  <p>What am I missing?</p>