fork download
  1. #include<stdio.h>
  2. #include<string.h>
  3. void main()
  4. {
  5. int len,i,vowel_count=0;
  6. char text[500];
  7. printf("\nEnter text:\n");
  8. gets(text);
  9. len=strlen(text);
  10. for(i=0;i<len;i++)
  11. {
  12. switch(text[i])
  13. {
  14. case 'a':
  15. case 'A':
  16. case 'e':
  17. case 'E':
  18. case 'i':
  19. case 'I':
  20. case 'o':
  21. case 'O':
  22. case 'u':
  23. case 'U':
  24. vowel_count++;
  25.  
  26. }
  27. }
  28. printf("\nTotal number of vowels in given text are %d\n ",vowel_count);
  29. }
  30.  
Runtime error #stdin #stdout 0s 2172KB
stdin
Standard input is empty
stdout
Enter text:

Total number of vowels in given text are 0