// An isogram is a word, in which no letter of the alphabet // occurs more than once. Write a C program that reads in // words until Ctrl+D, and checks whether the word is an isogram. #include #include #include #define MAX 100 int is_isogram(char word[100]); int main (void) { char word[MAX]; while(fgets(word, MAX, stdin) != NULL) { word[strlen(word) - 1] = '\0'; if(is_isogram(word)) { printf("This is an isogram\n"); } else { printf("This is not an isogram\n"); } } // PUT YOUR CODE HERE return 0; } int is_isogram (char word[100]) { int count[26] = {0}; int i = 0; while (word[i] != '\0') { char c = tolower(word[i]); if (isalpha(c)) { if (count[c - 'a'] > 0) { // we have a letter that has been repeated return 0; } count[c - 'a']++; } i++; } return 1; }