printf("Please enter one integer: ");
printf("Entered integer = \n");
In this program I prompted the user to enter their desire integer value but when the user accidentally or purposely enter an alphabet, the program generated an error. How do I prevent this kind of problem. Is it we have to declare a buffer first, then copy what ever inside the buffer which is a valid integer into 'int n'? If yes, how? If no, any other way?