EOF is entered by hitting ctrl-D, which shows up in the Terminal as a ^D, much as a break (ctrl-C) shows as ^C. Your shell prints out the ^D sequence, and then your program writes out a numberin the same position.
^D becomes
9D or something, if you print a 9.

Did you ever wonder why we had to run for shelter when the promise of a brave new world unfurled beneath the clear blue sky?