✅ The verified answer to this question is available below. Our community-reviewed solutions help you understand the material better.
Consider the execution of the following code fragment:
int foo(char const array[]) {
int i, val;
for (i = val = 0; array[i]; ++i) {
val = (array[i] == ' ') ? val+1 : val;
}
return val;
}
fputs("Enter a sentence: ", stdout);
char str[256];
fgets(str, 256, stdin);
printf("%i", foo(str));
If the user enters the text today is a good day [followed by the keyboard button] in response to the program's prompt, write the exact text printed to the standard output stream by the code fragment's final statement.
Get Unlimited Answers To Exam Questions - Install Crowdly Extension Now!