Cprogramming.com FAQ > How do I get my program to wait for a keypress?

You also have exit calls in there that aren't waiting for keypresses either, so it's possible one of your if checks is just...