The fgets function reads characters from the stream stream up to and including a newline character and stores them in the string s , adding a
Does fgets stop at newline?
fgets terminates at the newline character but appends it at the end of the string str . The function also appends the terminating null character at the end of the passed string.
Does fgets include the newline character?
The fgets() function stores the result in string and adds a NULL character (\0) to the end of the string. The string includes the newline character, if read.