The fputs( ) function writes the content of the string pointed to by str to the specified stream. The null terminator is not written. The fputs( ) function returns the last character written on success and EOF on failure.
printf("enter the text\n")
Output: Suppose we enter this text after running the program:
Ashish Kumar Gupta
Master of computer application
Press ctrl Z when the first line of text is entered and enter key is pressed the functions gets() converts the newline character and array str contains "Ashish Kumar Gupta"(18 character + 1 null character). the null character is not written to the file , so only 18 character are written.