example 5-4: get character from terminal input