How do i get the screen to pause?

Posted by Dakota on Stack Overflow See other posts from Stack Overflow or by Dakota
Published on 2010-04-27T23:20:28Z Indexed on 2010/04/27 23:23 UTC
Read the original article Hit count: 256

Filed under:
|
|
|
|

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?

include

using namespace std;

int area(int length, int width);        /* function declaration */

/* MAIN PROGRAM: */
int main()
{
    int this_length, this_width;      

    cout << "Enter the length: ";             /* <--- line 9 */
    cin >> this_length;
    cout << "Enter the width: ";
    cin >> this_width;
    cout << "\n";                             /* <--- line 13 */

    cout << "The area of a " << this_length << "x" << this_width;
    cout << " rectangle is " << 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 */

© Stack Overflow or respective owner

Related posts about c++

Related posts about c++builder