main()
{
int x=0;
char i=0,a[100];
int count=0,count2=0,choice;
printf("\n\nEnter a line of text:");
scanf("%[^\n]",a);
while(a[i]!='\0')
{
if(a[i]!=' ')
count++;
if(a[i]=='a'||a[i]=='A'||a[i]=='e'||a[i]=='E'||a[i]=='i'||a[i]=='I'||a[i]=='o'||a[i]=='O'||a[i]=='u'||a[i]=='U')
{
count2++;
}
i++;
}
printf("\nThe number of letters in this word is: %d",count);
printf("\nThe number of vowels in this word is: %d\n",count2);
}
No comments:
Post a Comment