COMPANY: CODTECH IT SOLUTIONS
NAME: YASH JAIN
INTERN_ID: CT06DG3399
DOMAIN: C PROGRAMMING
DURATON: 6 WEEKS
MENTOR: NEELA SANTOSH
DESCRIPTION: I have performed the task titled "File Handling Program" in the C programming language, which demonstrates fundamental file handling operations such as file creation, data writing, reading, and appending using the standard C library (stdio.h and stdlib.h), which provide the necessary functions for handling files efficiently. It simulates a basic use-case where user information is collected including ID, name, domain, college name, company name, and job type. All this information is then stored and managed within a text file named task1.txt. This task can be implemented and tested in Local Desktop Environment.
Objective of the Program:
- Create a new text file using the standard C file handling functions.
- Accept basic user details from console.
- Write the collected data into the text file using write mode ("w").
- Reopen the file to read in read mode ("r") and display the stored data.
- Reopen the file in append mode("a") to add additional details without overwriting existing data.
- Handle files safely by checking for errors and closing each file properly using fclose().
Tools and Technologies Used:
- Programming Language: C
- Standard Libraries Used: -> <stdio.h>: Provides file handling functions like fopen(), fprintf(), fscanf(), fclose(), printf(), and scanf(). -> <stdlib.h>: Included for additional utility functions and safe exit handling.
- Compiler: GCC (GNU Compiler Collection)
- Editor Platform: Code Blocks
Program Summary:
- Create a file name task1.txt using fopen() function in write ("w") mode.
- Write the data in the file using "fprintf" function which is collected through the console.
- Close the file using 'fclose()' function', to ensure the data is saved and no memory leaks occur.
- Now reopen the file in 'read(r) mode' to read the data from the file on the screen using "fscanf()" function.
- Again close the file using 'fclose()' function'
- Again reopen the file but in 'append(a) mode' to add the new data to the file without erasing previously existing(or written) data.
- Write the data to be input using anothe 'fprintf()' function.
- Print the data in the file using "fprintf" function.
- Close the file using 'fclose()' function'
Thank you!

