Prototype : -
#include <stdio.h>
char *fgets(char *s, int size, FILE *stream);
Defination :-
fgets() reads in at most one less than size characters from stream and stores them into the buffer pointed to by s. Reading stops after an EOF or a newline. If a newline is read, it is stored into the buffer. A terminating null byte (”) is stored after the last charac?
ter in the buffer.
Use :-
It is used to scan a string with spaces until a new line character or EOF character is inserted.
It takes input until enter is pressed.
It is used in place of scanf();