Using getchar() instead of fgets()