The shop spells its sign with letter tiles, and every space needs an empty clip. Write count_spaces(sign) to count the spaces in sign. No spaces gives 0.
count_spaces("OPEN ALL DAY")→2count_spaces("TEA")→0int count_spaces(const char *sign)int count_spaces(const char *sign) {
int n = 0;
for (int i = 0; sign[i] != '\0'; i++) {
// your code here: if this character is a space, add 1 to n
}
return n;
}
Run tries the examples. When they look right, Submit.