My program requires user to enter a 4-digit number(int type). Currently, when the user enters any character other than numeric, the program crashes. My hope is that when the user enters a non-numeric character, the program can tell the user "Wrong input" then let the user re-enter.
Does exception handling work for this? Or is there any other good way to solve this?