put system("PAUSE") instead of return 0 , but try not to use this when your programs get more complicated , but you will figure that out on your own.