After entering data and pressing "enter", console window disappears
I wrote a fairly simple programme:
Code:
#include <iostream>
int main()
{
using namespace std;
int books; // declares variable "books"
cout << "how many books do you have?" << endl; // displays the first line
cin >> books; // input a number
cout << "here are 100 more." << endl; // displays the second line
books=books+100; // adds 100 to the variable "books"
cout << "now you have " << books << " books." << endl;
//displays the third line with the changed variable "books"
cin.get();
return 0;
}
It successfully compiled. When run, it correctly displays the first line:
how many books do you have?
Then I entered a random number, like 500. I pressed "enter" then the console window immediately disappeared.
My IDE is dev c++, OS is windows xp service pack 2