Experiment No 11
Experiment No 11
Sample Problem: Implement a file operation that would write some strings in a file, and read
from it.
Required equipment and devices:
1. PC/Laptop
2. Code Blocks IDE
3. GNU/GCC
int main(){
// File Create
FILE *Jisan;
char buffer[30], c;
// write file
printf("Write the file\n");
Jisan = fopen("Jisan.txt", "w");
while ((c = getc(Jisan)) !=EOF) printf("%c", c);
fclose(Jisan);
return 0;
}
Input/Output Screenshot:
Fig-1
Fig-2
Fig-3
References: