Use fputs() instead of fprintf() to write a string to a FILE*.
Only use one call to print a string and a newline.  No need for both fprintf() and putc() when one fprintf() call is enough.