Your problem is, most likely, that your code does not compile since you are using several functions (getch(), clrscr(), etc) that are not part of the standard C library.

Your usage of exit() -...