fork download
  1. #include <stdio.h>
  2. #include <string.h>
  3.  
  4. int main() {
  5. char s[100];
  6. int c = 0, i;
  7.  
  8. printf("Enter a string: ");
  9. fgets(s, 100, stdin);
  10.  
  11. for (i = 0; s[i] != '\0'; i++) {
  12. if (s[i] == 'a' || s[i] == 'A' || s[i] == 'e' || s[i] == 'E' || s[i] == 'i' || s[i] == 'I' || s[i] == 'o' || s[i] == 'O' || s[i] == 'u' || s[i] == 'U') {
  13. c++;
  14. }
  15. }
  16.  
  17. printf("Vowels count: %d\n", c);
  18.  
  19. return 0;
  20. }
Success #stdin #stdout 0s 5312KB
stdin
Standard input is empty
stdout
Enter a string: Vowels count: 0