Question: why use fgets instead of gets?
Answer: Unlike gets(), the fgets() function retains the newline character, meaning that the function cannot be used as a direct replacement for gets(). When using fgets() it is possible to read a partial line. ... The fgets() function reads at most one less than the number of characters specified from the stream into an array.