gets() vs fgets()
We can take string as input with the help of gets() function but this function suffers with the problem of buffer overflow as it does not care about the maximum limit of array of characters (do not perform aray bound testing) and it takes input as long as it sees a newline character. Apart from it, fgets reads string input till the maximum limit of array is reached.