Skip to main content
Bumped by Community user
added 49 characters in body
Source Link
Cliff B
  • 69.3k
  • 4
  • 33
  • 56

don't understand why it show error

:) initials.c exists
:) initials.c compiles
:( outputs "MB" for "Milo Banana"
   \ expected prompt for input, not output of "Input you name\n"
:( outputs "MB" for "milo banana"
   \ expected prompt for input, not output of "Input you name\n"
:( outputs "RTB" for "Robert Thomas Bowden"
   \ expected prompt for input, not output of "Input you name\n"
:( outputs "R" for "ROB"
   \ expected prompt for input, not output of "Input you name\n"
:( outputs "RTB" for "Robert thomas Bowden"

:) initials.c exists :) initials.c compiles :( outputs "MB" for "Milo Banana" \ expected prompt for input, not output of "Input you name\n" :( outputs "MB" for "milo banana" \ expected prompt for input, not output of "Input you name\n" :( outputs "RTB" for "Robert Thomas Bowden" \ expected prompt for input, not output of "Input you name\n" :( outputs "R" for "ROB" \ expected prompt for input, not output of "Input you name\n" code:( outputs "RTB" for "Robert thomas Bowden"

string s = GetString();

printf("%c", toupper(s[0]));

for (int i = 1, n = strlen(s); i < n; i++)
{
   if (s[i] == ' ')
   {
     printf("%c", toupper(s[i+1]));
   }
}

don't understand why it show error

:) initials.c exists :) initials.c compiles :( outputs "MB" for "Milo Banana" \ expected prompt for input, not output of "Input you name\n" :( outputs "MB" for "milo banana" \ expected prompt for input, not output of "Input you name\n" :( outputs "RTB" for "Robert Thomas Bowden" \ expected prompt for input, not output of "Input you name\n" :( outputs "R" for "ROB" \ expected prompt for input, not output of "Input you name\n" :( outputs "RTB" for "Robert thomas Bowden"

string s = GetString();

printf("%c", toupper(s[0]));

for (int i = 1, n = strlen(s); i < n; i++)
{
   if (s[i] == ' ')
   {
     printf("%c", toupper(s[i+1]));
   }
}

don't understand why it show error

:) initials.c exists
:) initials.c compiles
:( outputs "MB" for "Milo Banana"
   \ expected prompt for input, not output of "Input you name\n"
:( outputs "MB" for "milo banana"
   \ expected prompt for input, not output of "Input you name\n"
:( outputs "RTB" for "Robert Thomas Bowden"
   \ expected prompt for input, not output of "Input you name\n"
:( outputs "R" for "ROB"
   \ expected prompt for input, not output of "Input you name\n"
:( outputs "RTB" for "Robert thomas Bowden"

code:

string s = GetString();

printf("%c", toupper(s[0]));

for (int i = 1, n = strlen(s); i < n; i++)
{
   if (s[i] == ' ')
   {
     printf("%c", toupper(s[i+1]));
   }
}
Source Link

pset2 initials problem

don't understand why it show error

:) initials.c exists :) initials.c compiles :( outputs "MB" for "Milo Banana" \ expected prompt for input, not output of "Input you name\n" :( outputs "MB" for "milo banana" \ expected prompt for input, not output of "Input you name\n" :( outputs "RTB" for "Robert Thomas Bowden" \ expected prompt for input, not output of "Input you name\n" :( outputs "R" for "ROB" \ expected prompt for input, not output of "Input you name\n" :( outputs "RTB" for "Robert thomas Bowden"

string s = GetString();

printf("%c", toupper(s[0]));

for (int i = 1, n = strlen(s); i < n; i++)
{
   if (s[i] == ' ')
   {
     printf("%c", toupper(s[i+1]));
   }
}