[ create a new paste ] login | about

Link: http://codepad.org/xOlQIu1f    [ raw code | output | fork ]

C, pasted on May 24:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#include <stdio.h>
#include <conio.h>
 
int main(){
    char inputString[100]="Rasmita pattanaik";
   int index, frequency[256] = {0};
   for(index=0; inputString[index] != '\0'; index++){
        /* Populate frequency array */
        frequency[inputString[index]]++;
    }
    /* Print characters and their frequency */
    printf("\nCharacter   Frequency\n");
    for(index=0; index < 256; index++){
        if(frequency[index] != 0){
            printf("%5c%10d\n", index, frequency[index]);                    
        }
    }
 
    getch();
    return 0;
}


Output:
1
Line 18: error: conio.h: No such file or directory


Create a new paste based on this one


Comments: