/*Program to calculate frequency of vowels in a string*/

#include 
#include 
void main()
{
int a=0,e=0,i=0,o=0,u=0,sum=0;
char c;
clrscr();
printf("Enter string:- ");
printf("String will be terminated if you press Ctrl-Z & then ENTER.");
printf("STRING:- ");
while ((c=getchar())!=EOF)
{
if (c=='a'||c=='A')
a=a+1;
if (c=='e'||c=='E')
e=e+1;
if (c=='i'||c=='I')
i=i+1;
if (c=='o'||c=='O')
o=o+1;
if (c=='u'||c=='U')
u=u+1;
}
sum=a+e+i+o+u;
printf("Frequency of vowel 'a' is %d.",a);
printf("Frequency of vowel 'e' is %d.",e);
printf("Frequency of vowel 'i' is %d.",i);
printf("Frequency of vowel 'o' is %d.",o);
printf("Frequency of vowel 'u' is %d.",u);
printf("Total no. of vowels in the text is %d.",sum);
printf("HAVE A NICE DAY! BYE.");
getch();
}

Related Posts

No data
He led the Lightning with 17 points in 17 playoff games last season, and his 58 postseason Wholesale ...
No data
No data
No data
Looks like it's going to take more than a well-enforced curfew to help this team pick up some ...
No data
No data
No data
Residents selected to purchase tickets this year will receive Mobile Ticketing instructions along ...
No data
No data

Leave a Reply

Your email address will not be published. Required fields are marked *

Skip to toolbar