code written without errors (...)
No, not exactly. You can omit return value of printf
function but actually it's header is a little different. Not to mention that some people would scold usage of C functions when C++ tag is given (use streams).
Why shouldn't You use printf
without format string?
http://www.cprogramming.com/tips/tip/do-not-use-printf-without-percent-s-to-print-a-string
@Christian Hackl noticed in comment that it's quite safe to pass that particular string literal to printf
, but consider what happens with one that has percent character [%
], used inside printf
https://stackoverflow.com/a/31293816/4476122
Now, program closes, and if You didn't see any output - word You so cleverly selected to share publicly with us - You might want to read about buffering.