fork download
  1.  
Success #stdin #stdout 0.02s 25732KB
stdin
#include <stdio.h>
#include <ctype.h>

void count_characters() {
    char text[100];
    printf(" Enter number: ");
    fgets(text, 100, stdin);

    int char_count[26] = {0};
    for (char *p = text; *p; p++) {
        if (isalpha(*p)) {
            char_count[tolower(*p) - 'a']++;
        }
    }

    printf(" Enter number:\n");
    for (int i = 0; i < 26; i++) {
        if (char_count[i]) {
            printf("%c: %d\n", i + 'a', char_count[i]);
        }
    }
}

int main() {
    count_characters();
    return 0;
}
stdout
Standard output is empty