One option would be to write your prompts to stderr rather than stdout. They'll be visible on the terminal but not in output.txt.
Another option is not to use redirection for your output but take an output filename as a parameter and open that file yourself. You can then use stdout for your prompts. (This is more flexible. You can decide what goes only to the file, what goes only to the screen, and potentially what goes to both.)
If you can't change the code, the only option is to use tee or some other such utility. Buffering can be a problem; stdbuf might help with that.