Incorporating several basic ideas in C++ issue
<p>Code;</p>

<pre><code># include &lt;iostream&gt;
# include &lt;windows.h&gt;
using namespace std;

int main () {
    int var1 = 1;
    int var2 = 1;
    bool while1 = true;
    int x = 0;

    while (x &lt; 999) {
        x = x+var1;
        x = x+var2;
        cout &lt;&lt; x &lt;&lt; " Is the current value of x, how much would you like to add to it?\n";
        Sleep(1000);
        while (while1) {
            int var3;
            cin&gt;&gt; var3;
            if (var3 &gt; 100) {
                cout &lt;&lt; "Too large, between 10 and 100\n";
                while1 = true;
            } 
            else if (var3 &lt; 10) {
                cout &lt;&lt; "Too small, between 10 and 100\n";
                while1 = true;
            }
            else{
                cout &lt;&lt; "Adding " &lt;&lt; var3 &lt;&lt; " to " &lt;&lt; x &lt;&lt; "\n";
                x = x + var3;
                cout &lt;&lt; "x is now " &lt;&lt; x &lt;&lt; "\n";
                while1 = false;
            }
        }
    }
}
</code></pre>

<p>Now, the problem is after it loops back up the first time it completely skips over the second while statement and proceeds to continue adding just var1 and var2 to x.</p>

<p>What is the problem here?</p>
