If you just throw a whole bunch of ingredients together into a baking dish and put it in the oven, you won't get a cake out. You'll get a bunch of burnt ingredients.
Why didn't it work? Because you did it wrong.
Bake according to instructions.
Everything the computer does, and the way it works, follows rules. And the rules change depending on what you are doing. Follow the rules in effect and things will work right.
It is a bit confusing.
\r will move cursor to the beginning of a line.
\n will make a new line.
So, in my thinking \r\n and \n\r are the same.
For example:
Where: ++ present cursor position