Why does the program end when I enter a number?
<p>I began programming on C++ some days ago and something is really getting me troubles:</p>

<p>whenever I enter the number, the program ends.</p>

<p>Code:</p>

<pre><code>using namespace std;

int main()
{
    int entry;

    cout &lt;&lt; "Write a number: ";
    cin &gt;&gt; entry;
    cout &lt;&lt; entry;

    cin.get();
    return 0;
}
</code></pre>

<p>I need some help here so my programs could run right.</p>

<p>By right I mean to output the number after ending... but it just ends after I enter the number and press enter  It does not print it.</p>

<p><strong>UPDATE</strong>:</p>

<p>For the sake of the ones who didn't understood what I was meaning (sorry for my english)</p>

<p>Ok let me explain.</p>

<p>-So the program is suposed to get the values from the keyboard right.</p>

<p>-I enter a number let´s say is 6, ok now I press enter.</p>

<p>-Alright now the number is supposed to be output on the screen, but this doesn´t happen because the program closes too fast.</p>

<p>But this was solved actually, by adding a second <code>cin.get();</code> or by adding a <code>cin.ignore();</code> after each data input petition.</p>
