C programming -How to count number of repetition of letter in a word : I am trying to write a program where its supposed to count the occurrence of each characters using getchar()
For example if the input is xxxyyyzzzz ; the output should be 334 (x is repeated 3 times, y 3 and z 4times). 
If the input is xxyxx the output should be 212

Here's what i have tried so far
 
    double nc ;
    for (nc=0 ; getchar()!=EOF;++nc);
    printf ("%.0f\n",nc);
    return 0;
Input aaabbbccc
Output 10

Expected Output = 333

Unfortunately , this shows the total number of characters including enter but not the  repetition . I would really appreciate any suggestions for me to get this program going . Thank you


