What is the difference between \r, \n, \t, and \f in C programming?
These aren’t unique to “C programming”.
These are various “control characters”, originally used to control the write-head and paper feeder on Teletype machines.
\n is “line feed”. This would bump up the paper one line, whatever that was, but not move the write head.
If you did abc\ndef, the teletype would print
abc def \r is “carriage return”. This would cause the write head to return to its leftmost position.