|You said the screen "flicks back to the source code" - but that can I assume you are probably running your program from Visual Studio?|
If so, pressing F5 run your program in the debugger. Set a breakpoint at the end of your main function to get a chance to see the results before it terminates.
Alternatively, you can press ctrl-F5 to run without debugging. In that case, the console window will automatically pause when your program finishes.