You are using the function getch which does not reflect the characters on the screen. use getche instead of getch and it should be fine.