title: How do i get the screen to pause?
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/2529617/how-to-stop-c-console-application-from-exiting-immediately">How to stop C++ console application from exiting immediately?</a>  </p>
  </blockquote>
  
  
  
  <p>So im learning c++ and i was given this example and i wanted to run it. But i cannot get it to stay up, unless i change it. How do i get Microsoft visual 2010 to keep up the screen when it gets to the end of the program after I release it?</p>
  
  <pre><code>#include&lt;iostream&gt;
  using namespace std;
  
  int area(int length, int width);        /* function declaration */
  
  /* MAIN PROGRAM: */
  int main()
  {
      int this_length, this_width;      
  
      cout &lt;&lt; "Enter the length: ";             /* &lt;--- line 9 */
      cin &gt;&gt; this_length;
      cout &lt;&lt; "Enter the width: ";
      cin &gt;&gt; this_width;
      cout &lt;&lt; "\n";                             /* &lt;--- line 13 */
  
      cout &lt;&lt; "The area of a " &lt;&lt; this_length &lt;&lt; "x" &lt;&lt; this_width;
      cout &lt;&lt; " rectangle is " &lt;&lt; area(this_length, this_width);
  
      return 0;
  }
  /* END OF MAIN PROGRAM */
  
  /* FUNCTION TO CALCULATE AREA: */
  int area(int length, int width)   /* start of function definition */
  {
      int number;
  
      number = length * width;
  
      return number;
  }                                 /* end of function definition */
  /* END OF FUNCTION */
  </code></pre>