Question
Project 6, Program Design C Programming 1. (100 points) Write a program that prompts the user to enter the name of a file. The program
Project 6, Program Design C Programming
1. (100 points)
Write a program that prompts the user to enter the name of a file. The program (in C) finds the anagrams in the file.
Enter the file name: words.txt
Output: anagrams are written to file: words.txt.ang
The program reads the content of the file and stores the words in an array of strings,
the program then finds the anagrams and writes the anagrams to the output file.
1.Name your program fileIO.c.
The output file name should bethe same name as the input file but with an added extension of .ang.
In this example, the original file name is words.txt.
The output file name is then words.txt.ang.
Assume the file name is no more than 100 characters.
Assume the length of each line in the input file is no more than 100 characters.
Assume the input file contains no more than 1000 words.
2. The following function is provided in anagram.c:
int are_anagram (char *word1, char *word2);
word1 and word2 are strings containing the words to be checked for anagram. The function returns 1 if the two words are anagram . of each other and return 0 otherwise.
3. The output file should be in the following format. The output file contains all the anagrams.
1 inch
chin
2 roast beef
eat for BSE
...
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started