add input validation with getchar/compare asci-code remove scanf