void main()
{
char ch;
do{
char s[100];
int i,v=0,c=0;
clrscr();
printf("\n Enter a string :");
gets(s);
for(i=0;s[i]!=NULL;i++)
{
if(s[i]=='a'||s[i]=='e'||s[i]=='i'||s[i]=='o'||s[i]=='u'||
s[i]=='A'||s[i]=='E'||s[i]=='I'||s[i]=='O'||s[i]=='U')
{
v++;
}
else
{
if(s[i]!=' ')
c++;
}
}
printf("\n The total number of vowel is[%d] and consonants is [%d] ",v,c);
printf("\n Continue (y/n):");
ch=getch();
}while(ch=='y'||ch=='Y');
}
c prog
,
Subscribe to:
Posts (Atom)
Popular Threads
releated post
loading..