#include<iostream>
using namespace std;
int main(){
string a;
cout<<"enter string ";
getline(cin,a);
int freq[256]={0};
int b;
for(int i=0;a[i]!=' ';i++){
b=a[i];
freq[b]++;
}
for(int i=0;i<256;i++)
{
if(freq[i]!=0){
cout<<"The frequency of "<<char(i)<<" is "<< freq[i]<<endl;
}
}
}
#include <iostream>
using namespace std;
int main() {
char str[100] = "this string contains many alphabets";
char c = 'a';
int count = 0;
for(int i = 0; str[i] != ' '; i++) {
if(str[i] == c)
count++;
}
cout<<"Frequency of alphabet "<<c<<" in the string is "<<count;
return 0;
}