A C program without a return value will result in undefined behavior (which is unanimously considered bad type ©). The compiler is allowed to freely control what it returns here, it seems to return the result of scanf (), but it can return some atmospheric entropy for all the cares of C Standard.
As for the line not printing, because you are using printf () on a buffered terminal, you need to add \ n to the end. The reason for this comes down to the ancient ways of Unix, which have long been forgotten by everyone except the sagist of the Unix guru.
Like nothing happens until you enter something, because scanf () is blocked until you get input, in case you did not know about it yet. Non-blocking I / O calls can be used, but I'm not sure if this concerns your question. (please specify "do it right").
source share