Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

******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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Design And SQL For DB2

Authors: James Cooper

1st Edition

1583473572, 978-1583473573

More Books

Students also viewed these Databases questions

Question

Explain the function and purpose of the Job Level Table.

Answered: 1 week ago