You need to go and look up the return value from getchar() ....