#include
void main()
{
int x,count=0,a=0,e=0,i=0,o=0,sp=0,u=0,total=0;
char str[1000];
printf("Enter a Word : ");
gets(str);
for(x=0;str[x]!=0;x++)
{
switch (str[x])
{
case ' ': sp++;break;
case 'a': a++; break;
case 'e': e++; break;
case 'i': i++; break;
case 'o': o++; break;
case 'u': u++; break;
default: count++;
}
total=a+e+i+o+u+count;
}
printf("\nSpaces count: %d",sp);
printf("\nNumber of a's %d",a);
printf("\nNumber of e's %d",e);
printf("\nNumber of i's %d",i);
printf("\nNumber of o's %d",o);
printf("\nNumber of u's %d",u);
printf("\nNumber of letterss %d",total);
}
Sunday, December 14, 2008
Finding the Vowels and the Letter Count in a Sentence
Posted by
BADTNC
at
1:00 PM
Labels: C Programming
Subscribe to:
Post Comments (Atom)

0 comments:
Post a Comment