A little C++ help please(repeated output)
<p>SO i have this code:</p>

<pre><code>#include &lt;iostream&gt;
#include &lt;cstdlib&gt;
using namespace std;

int main()
{

    int x;
    x=rand();
    int guess;
    do{
        cout&lt;&lt;"Enter your guess:";
        cin&gt;&gt;guess;
        if(guess==x)cout&lt;&lt;"You got it ! ;)\n";
        else {
            cout&lt;&lt;"Wrong(";
            if (guess&lt;x) cout&lt;&lt;"too small)\n";
            else cout&lt;&lt;"too big)\n";
        }

    } while (guess != x);

    return 0;
}
</code></pre>

<p>question: After compiling and running this program, i enter "999999999999" and it keeps repeating the "too big". why is this so?</p>

<p>additional info: when i set the value of x to constant 10, and i entered 11, i notice it only repeats "too big" once. is there something i am not aware of? or is the code flawed?</p>

<p>many thanks :)</p>
