basics · beginner · ~15 min
Loop over a string testing membership.
Count the lowercase vowels in a string.
Implement int count_vowels(const char *s) that returns how many characters of s are lowercase vowels (a, e, i, o, u). Uppercase letters do not count. No main — the grader calls it.
A NUL-terminated string s.
Returns the number of lowercase vowels, as an int.
count_vowels("hello") -> 2
count_vowels("aeiou") -> 5
count_vowels("rhythm") -> 0
a e i o u count.A NUL-terminated string s.
The number of lowercase vowels, as an int.
Only lowercase a, e, i, o, u count.
int count_vowels(const char *s) {
/* TODO */
return 0;
}
Solve this exercise in the browser editor — compile and run against the test harness, no setup required.