On ubuntu16.04, I use g++ to compile such code:
#include int main() { std::cout << \"Hello World!\"; return 0; }
It doesn't, it's your bash prompt.
You can reproduce your problem with echo:
echo
# echo "Hello, World!" Hello, World! # echo -n "Hello, World!" Hello, World!#