Question
******Are_anagram function: int are_anagram(char *word1, char *word2) { int letter_counts[26]={0}; char *p; char *q; int i, count =0; char ch; for(p = word1; *p!='0'; p++)
******Are_anagram function: int are_anagram(char *word1, char *word2) { int letter_counts[26]={0}; char *p; char *q; int i, count =0; char ch; for(p = word1; *p!='\0'; p++) if(isalpha(*p)) { ch = tolower(*p); letter_counts[ch - 'a']++; } for(q = word2; *q!='\0'; q++) if(isalpha(*q)) { ch = tolower(*q); letter_counts[ch - 'a']--; } for(i =0;i<26;i++) { if(letter_counts[i]==0) count++; } if(count == 26) return 1; else return 0; return 0; } *****Content of words.txt file: rail safety inch roast beef eat for BSE William Shakespeare Madam Curie lake morning Radium came I am a weakish speller Heir hire computer science chin knee array length leak kiss ****this is the read_line function if you need*** int read_line(char *str, int n) { int ch, i =0; while ((ch = getchar()) != ' ') { if (i
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