You can't read a character into an integer variable.
The most common solution to this is to read theinput as a string, check whether it's numerical digits only, then convert it to an integer using atoi() or something.