You didn't do anything wrong. The reason the screen closed is because it has finished executing your program and so it exits.
It's actually displaying the Hello World then closing really fast.
Your best bet is to run your program through the Command Prompt so that the window does not close after execution. To do this:
Go to start, run, type cmd
You'll then need to navigate to the location of your exe file. Once you are in the correct folder just type name.exe and it will run and display your text!
|