cout doesn't work

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#include <iostream>
using namespace std;

int main()
{	
	int y;
	cout <<"Try cout !!\n\n";
	cout <<"Input number : ";
	cin >> y;
	cout <<"\nYour number : "<< y <<"";



	getchar();
	return 0;
}

This is my code, and... when I compile and run, CMD open, and it request an input, and it make output "Your number : 7"(I inputed 7), but it suddenly close, like there is no getchar
I put getchar();, but it doesn't work.
Please help me
The origional problem isn't exactly like yours but the solutions are:

http://www.cplusplus.com/forum/beginner/1988/

There is a very good reason that thread was made into a sticky.
Topic archived. No new replies allowed.