Yes.
getchar
waits for you to enter "something"; and Enter is 'something' (that is, it has a defined character value; other keys, Shift for example, may not).
By that same token, the key combo Ctrl+Z would be "something" as well -- the value 26
on most systems -- but the standard input/output library you are using treats this particular code as a special command: EOF
. On my OS, Mac OSX, that would be Ctrl+D (for reasons unknown to me, other than "historically, Ctrl+D is used to signal EOF on Unix-like systems").
The 'newline character' is by no means "hidden" or "invisible", it's just another number that gets read and stored into a variable or string if you instruct it to do so. The reason you cannot see it is because putchar
and other text printing functions do something else than "display the associated character": it moves the cursor to the next line. That also is part of the standard functionality, and a good thing it is too. After all you wouldn't want to press Space to "move to the next line". (In fact it's such a common function of this code that most fonts don't even bother to have a displayable item for it.)
See also What does getchar() exactly do? for more background information.