Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- int main() {
- char array[100]; int i; int c = 0;
- printf("Enter a string\n");
- gets(array);
- printf("You entered the string %s\n",array);
- for (i = 0; i < sizeof(array)/sizeof(array[0]) && array[i] != 0; i++)
- {
- if (array[i] == 'a' || array[i] == 'A' || array[i] == 'e' ||
- array[i] == 'E' || array[i] == 'i' || array[i] == 'I' || array[i] == 'o' || array[i] == 'O' ||
- array[i] == 'u' || array[i] == 'U' && array[i] != '0')
- {
- c = c + 1;
- }
- }
- printf("There are %d vowels in your string\n", c);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement