Frage
Vielleicht so:
#include <stdio.h> /* printf, scanf */
#include <stdlib.h> /* EXIT_SUCCESS, size_t */
#define WORD_MAX 40
#define TO_STR_(thing) #thing
#define TO_STR(thing) TO_STR_(thing)
int main(void) {
char word[WORD_MAX + 1] = { '\0' };
size_t count['z' - 'a' + 1] = { 0u };
const size_t count_len = sizeof(count) / sizeof(* count);
size_t i = 0u;
char c = '\0';
printf("Wort eingeben: ");
fflush(stdout);
while (1 != scanf(" %" TO_STR(WORD_MAX) "s", word)) {
printf("Nochmal: ");
fflush(stdout);
}
for (i = 0u; (c = word[i]); ++i) {
if (c >= 'a' && c <= 'z') {
++count[c - 'a'];
}
}
printf("Wort '%s':", word);
for (i = 0; i < count_len; ++i) {
if (count[i]) {
printf(" %c:%lu", (char)('a' + i), count[i]);
}
}
printf("\n");
return EXIT_SUCCESS;
}