Question: how is fgets better than scanf?
Answer: The main difference lies in the fact that scanf has no limits on the number of characters that can be read (in its default use), while fgets has a maximum number of char that can be read. See the prototype of the two functions: char * fgets (char * dest, int size, FILE * stream);