Advertisement
Guest User

Untitled

a guest
Nov 21st, 2014
197
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.59 KB | None | 0 0
  1. #include <stdio.h>
  2. int main() {
  3.  
  4. char array[100]; int i; int c = 0;
  5. printf("Enter a string\n");
  6. gets(array);
  7. printf("You entered the string %s\n",array);
  8.  
  9. for (i = 0; i < sizeof(array)/sizeof(array[0]) && array[i] != 0; i++)
  10. {
  11. if (array[i] == 'a' || array[i] == 'A' || array[i] == 'e' ||
  12. array[i] == 'E' || array[i] == 'i' || array[i] == 'I' || array[i] == 'o' || array[i] == 'O' ||
  13. array[i] == 'u' || array[i] == 'U' && array[i] != '0')
  14.  
  15. {
  16.  
  17. c = c + 1;
  18.  
  19. }
  20.  
  21. }
  22.  
  23. printf("There are %d vowels in your string\n", c);
  24.  
  25. return 0;
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement