Some IDEs close the window as soon as the program finishes execution, and some leave it open.To see the output, you must place some additional code at the end of the program:
cin.get(); // add this statement
But, is some rare cases, cin.get() is used two times consecutively; without it the output is not shown.
cin.get(); // add this statement
cin.get(); // and maybe this, too
The problem is that cin.get(); reads one character. In the perfect case it's your "Enter press" at the end of the program. But if a character is still in the input buffer (not flushed) like '\n', cin.get () will read it, so you will need another cin.get() to read your "Enter press".
There is also a sticky thread on "Closing Down The Console" in the Beginner forum.