#include #include #include #include #include #include #include // Hashes word to a number int main(void) { char *word = "cat"; // (sum of (letter - 'A') % 26) of a word to get a value of where to store it in the hash table int val = 0; for (int i = 0; word[i] != '\0'; i++) { val += toupper(word[i]) - 'A'; } return val %= 26; }