scanf does not echo the input as it is typed. The only reason you may see your input on the screen is because you are typing it in - if you redirect the input from a file, it won't echo the input at all.
Your program is in an infinite loop and never ends. It also doesn't handle anything after a 2 digit number, since the newline is read as the first character of the next line. In fact, I don't think getch even works at all in this type of problem.