Frequency of vowels in the given string. Nov, 2020
Solution in C PYTHON
#include<stdio.h>
int main() {
char str[50];
int i,j,k,count;
gets(str);
for(i=0;str[i]!='\0';i++){
count=1;
if(str[i]=='a' || str[i]=='e' || str[i]=='i' || str[i]=='o' || str[i]=='u' ){
for(j=i+1;str[j]!='\0';j++){
if(str[i]==str[j]){
count++;
for(k=j;str[k]!='\0';k++)
str[k] = str[k+1];
}
}
printf("%c - %d\n",str[i],count);
}
}
}
int main() {
char str[50];
int i,j,k,count;
gets(str);
for(i=0;str[i]!='\0';i++){
count=1;
if(str[i]=='a' || str[i]=='e' || str[i]=='i' || str[i]=='o' || str[i]=='u' ){
for(j=i+1;str[j]!='\0';j++){
if(str[i]==str[j]){
count++;
for(k=j;str[k]!='\0';k++)
str[k] = str[k+1];
}
}
printf("%c - %d\n",str[i],count);
}
}
}
hello how are you?
e - 2
o - 3
a - 1
u - 1