title: C++ console application exiting immediately?
body: <p>I am trying to learn C++ using Visual Studio 2013 but I have an issue that prevents me to proceed. After starting the console on debug and getting input from a user console immediately closing. How can I make my program wait my command to close?</p>
  
  <pre><code>#include &lt;iostream&gt;
  #include &lt;cmath&gt;
  
  using namespace std;
  
  int main()
  {
      double number, answer;
      cout &lt;&lt; "Enter a number: ";
      cin &gt;&gt; number;
      answer = sqrt(number);
      cout &lt;&lt; "Square root is " &lt;&lt; answer &lt;&lt; endl;
      cin.get();
      return 0;
  }
  </code></pre>