Write a recursive C function that counts the number of vowels in a string. You may wish to call the is_element function. Solution #include <string.h> int vowels(char *str,int count) { if(!*str) return count; char ch=lower(*str); int match=ch==\'a\' || ch==\'e\' || ch==\'i\' || ch==\'o\' || ch==\'u\'; return vowels(++str, count+match); } int main(void) { int i,t, pom; char str[30]; scanf(\"%d\", &t); for(i=0;i<t;i++) { scanf(\"%29s\", str); pom=vowels(str,0) printf(\"%d\ \", pom); } return 0; } .
Write a recursive C function that counts the number of vowels in a string. You may wish to call the is_element function. Solution #include <string.h> int vowels(char *str,int count) { if(!*str) return count; char ch=lower(*str); int match=ch==\'a\' || ch==\'e\' || ch==\'i\' || ch==\'o\' || ch==\'u\'; return vowels(++str, count+match); } int main(void) { int i,t, pom; char str[30]; scanf(\"%d\", &t); for(i=0;i<t;i++) { scanf(\"%29s\", str); pom=vowels(str,0) printf(\"%d\ \", pom); } return 0; } .