Below, is a list of file handling exercises –
Write a C program to create a file and write contents, save and close the file. Write a C program to read file contents and display on console. Write a C program to read numbers from a file and write even, odd and prime numbers to separate file. Write a C program to append content to a file. Write a C program to compare two files. Write a C program to copy contents from one file to another file. Write a C program to merge two file to third file. Write a C program to count characters, words and lines in a text file. Write a C program to remove a word from text file. Write a C program to remove specific line from a text file. Write a C program to remove empty lines from a text file. Write a C program to find occurrence of a word in a text file. Write a C program to count occurrences of a word in a text file. Write a C program to count occurrences of all words in a text file. Write a C program to find and replace a word in a text file. Write a C program to replace specific line in a text file. Write a C program to print source code of same program. Write a C program to convert uppercase to lowercase character and vice versa in a text file. Write a C program to find properties of a file using stat() function. Write a C program to check if a file or directory exists. Write a C program to rename a file using rename() function. Write a C program to list all files and sub-directories recursively.