While reading a %d integer value into scanf, is there a way to restrict or check input so that invalid input like characters won't mess up the program?