To write in file what things we require ?
-A file pointer.
-fopen() function to open file.
-fprintf() to write in file.
-fclose() to close the file.
Open file in write mode:
-This function are write the text content inside the file.
//open file in write mode
printf("Now we put data inside the filen");
fclose(fp);// close file
printf("Your file is safely closed now");
This is my data which i store inside my file
Now we put data inside the file
Your file is safely closed now
-In this program, we take an input of the text and open the file in write mode then store input text inside the file as shown above.