The English diary needs enough words. Write count_words(s) to count the words in s. Words are separated by spaces, maybe several, and there may be spaces at the start or end; an empty string gives 0.
count_words("went to the zoo")→4count_words("")→0int count_words(const char *s)int count_words(const char *s) {
int words = 0;
for (int i = 0; s[i] != '\0'; i++) {
// your code here: not a space, and first or after a space, means a new word
}
return words;
}
Run tries the examples. When they look right, Submit.