What happens on your system when you replace \n with \r? The most likely result is that it will appear as if no greeting was printed at all. If that is the case, what actually happened is the text printing focus went back to the beginning of the line but the line was not advanced; the console prompt wrote over it, wiping out our greeting. If you want to advance to the next line without returning to the beginning of the line, try the <linefeed> character, or \v.
Digraphs that appear in strings are also called escape sequencesbecause they escape from the normal meaning of each single character. They all begin with the backslash (\) character. The following table shows the legal C digraphs:
Symbol | Meaning |
\a | Alert | ...