Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<stdio.h>
- int main()
- {
- char a[100];
- int vowel=0, i;
- printf("Write a sentence: \n");
- gets(a);
- for(i=0; a[i]!='\0'; i++)
- {
- if
- ( a[i]== 'a' || a[i]== 'e' ||a[i]== 'i' ||a[i]== 'o' ||a[i]== 'u' || a[i]== 'A' ||a[i]== 'E' ||a[i]== 'I' ||a[i]== 'O' ||a[i]== 'U' )
- {
- vowel++;
- }
- }
- printf("The number of vowels are : %d" , vowel);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment