find the frequency of each letter in a string using c programming
find the frequency of each letter in a string using c programming
We will find the frequency of each letter in a string using c programming. This program will find the occurrence of each character in given string
#include<stdio.h> #include<conio.h> #include<string.h> void main() { char str1[10],ch; int n,i,j; clrscr(); printf("Enter the String \n"); gets(str1); for(i=0;str1[i]!='\0';i++) { for(j=0;str1[j]!='\0';j++) { if(str1[i]==str[j]) { n++; } } printf("%s is found %d times",str[i],n); } getch(); }