int main(void) { string s = get_string(); if ((s[0] >= 'A' && s[0] <= 'Z') || (s[0] >= 'a' && s[0] <= 'z')) printf("%c", toupper(s[0])); //print first letter in uppercase printf("%c", toupper(s[0])); for (int i = 0, n = strlen(s); i < n; i++) while (s[i] == ' ' || s[i] == '\0') { i++; if (s[i] != ' ') printf("%c", toupper(s[i])); } printf("\n"); }

check50 shows error:

“:( Outputs HJ for hailey James
:( Outputs HJ for hailey James”

What problem I have? Help me, please)


I'm thinking that you can't see what's wrong because you're not aware of exactly what is being tested, but once you know the test, I think you'll quickly resolve the problem.

What happens when one or more spaces are at the end of the string, as in "hailey James "?

If this answers your question, please click on the check mark to accept. Let's keep up on forum maintenance. ;-)

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .