Advertisement
Guest User

Untitled

a guest
Jan 20th, 2017
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.40 KB | None | 0 0
  1. #include <stdio.h>
  2.  
  3. int count_vowe(const char *text) {
  4. const char *ch = text;
  5. int count = 0;
  6.  
  7. for (; *ch != '\0'; ch++) {
  8. switch (*ch) {
  9. case 'a':
  10. case 'e':
  11. case 'i':
  12. case 'o':
  13. case 'u':
  14. case 'A':
  15. case 'E':
  16. case 'I':
  17. case 'O':
  18. case 'U':
  19. count++;
  20. }
  21. }
  22.  
  23. return count;
  24. }
  25.  
  26. int main(void) {
  27. printf("vowe = %d\n", count_vowe("aeiou"));
  28. return 0;
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement