Validating input values with an if/else statement in C++ <p>So I've looked around but I'm apparently either not looking in the right place or I'm misunderstanding something.</p> <p>The directions given are that the program can only accept values between 2.0 and 5.0 for vault heights. I get the feeling it has to do with my if condition but I'm not sure how to correct it. </p> <p>When I input the height during debugging, it jumps to my else statement, and doesn't give me a chance to re-enter the new input.</p> <pre><code>//Retrieving name and first vault and date cout &lt;&lt; "Please enter the name of the pole vaulter.\n"; getline(cin, name); cout &lt;&lt; "Please enter the height of the first vault attempt.\n"; cin &gt;&gt; vault1; if(5.0 &gt;= vault1 &gt;= 2.0) { cout &lt;&lt; "What date was this vault accomplished?\n"; getline(cin, date1); } else { cout &lt;&lt; "Only jumps between 2.0 meters and 5.0 meters are valid inputs. Please enter the height of the first vault attempt.\n"; cin &gt;&gt; vault1; cout &lt;&lt; "What date was this vault accomplished?\n"; getline(cin, date1); } </code></pre>