add the following line to your code :
add to the end, just before the return 0.

getch();


Another option is, first compile the code, run it, and press Alt+F5 to view the output.