Start New Discussion within our Software Development Community

{-='Display the number of letters in each word typed using Dev-C LaNguaGe'=-}

#include <stdio.h>

int main (void)
{
//	Local Declarations
	char letters[26] = {'a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z'};
    int frequency[27]= { 0 };
    int i, f;
    
//  Statements
    printf("\nEnter your characters: \n");
    scanf(" %c", &letters[i]);
    for(i = 0; i < letters[i]; i++) 
     {
         f = letters[i];
         frequency[f]++;         
     }// for
    
   	for (i = 0; i < 27; i++)
	   printf(" %c - %d\n", letters[i], frequency[i]);
	printf("\n");
	
	system("pause");
	return 0;
}// main