This sentence from k&r:
A text stream consists of a sequence of lines; each line ends with a newline character....For instance, the library might convert carriage return and linefeed to newline on input and back again on ouput.
How can you convert linefeed to newline and why is it done?