|
Help!! I'm stumped!
Prompts the user to enter a string. Manipulate the string as in the example below.
Enter a string: hello
After capitalizing the first letter of this string it becomes: Hello
After capitalizing the last letter of this string it becomes HellO
After adding three to the first letter of this string it becomes KellO
After swapping the first and last letters of this string it becomes OellK
This is what i have so far: (excluding #includes)
char message[50];
cout<<"Enter a string: ";
cin>> message;
cout<<"After capitalizing the first letter of this string it becomes: ";
message[0] = toupper (message [0]);
cout<<message;
cout<<"\n""After capitalizing the last letter of this string it becomes: ";
cout<<message;
cout<<"\n""After adding three to the first letter of this string it becomes: ";
cout<<message;
cout<<"\n""After swapping the first and last letters of this string it becomes: ";
cout<<message<<"\n""\n";
system("PAUSE");
system("CLS");
|