Visual C++ Program Termination
Ok I know this probably yields a simple answer but when I used DJGPP and wrote a program such as this:
Code:
// This program will calculate the product of 3 integers.
#include <iostream>
using std::cout;
using std::cin;
using std::endl;
int main()
{
int x,y,z,result;
cout<<"Enter three integers: ";
cin>>x>>y>>z;
result = x*y*z;
cout<<"The product is "<<result<<endl;
return 0;
}
It would execute and stay there so one could view the result. But now on Visual C++ the second I enter the 3 numbers the dos prompt disappears making it impossible to see the results. How do you prevent this?