No, int main ( void ).
exit must have an argument of 0, EXIT_FAILURE, or EXIT_SUCCESS to be portable. No argument is an error. You also haven't included stdlib.h.
Not portable and you didn't include conio.h.
Here are my corrections, I switched getchar with getch for portability reasons. If you want to change back do not forget to include conio.h.
puts("cannot open the file");