fork download
  1. #include <stdio.h>
  2. #include <ctype.h>
  3. #include <string.h>
  4.  
  5. void checkString(const char *str)
  6. {
  7. char myVowels[] = "AEIOUaeiou";
  8.  
  9. printf("checking %s... ", str);
  10.  
  11. while(*str != '\0')
  12. {
  13. if(isdigit(*str))
  14. printf("Digit here ");
  15. if(strchr(myVowels,*str))
  16. printf("vowel here ");
  17. str++;
  18. }
  19.  
  20. printf("\n");
  21. }
  22.  
  23. int main(void)
  24. {
  25. checkString("");
  26. checkString("bcd");
  27. checkString("123");
  28. checkString("by");
  29. checkString("aye");
  30. checkString("H2CO3");
  31. return 0;
  32. }
  33.  
Success #stdin #stdout 0s 1788KB
stdin
Standard input is empty
stdout
checking ... 
checking bcd... 
checking 123... Digit here Digit here Digit here 
checking by... 
checking aye... vowel here vowel here 
checking H2CO3... Digit here vowel here Digit here