Question: Write a C++ program in a file called pp8a.cpp to ask the user for two words, then print them out in alphabetical order using strcmp.
Write a C++ program in a file called pp8a.cpp to ask the user for two words, then print them out in alphabetical order using strcmp.
) Execute your program and compare its output to the Expected Output column.
| Input | Expected Output |
| Enter hello for the first word and help for the second | Enter first word: hello Enter second word: help hello help |
| Enter help then hello | Enter first word: help Enter second word: hello hello help |
| Enter hello then hello | Enter first word: hello Enter second word: hello hello hello |
Enter hello and HELLO [Note how uppercase letters have a smaller ASCII value than lowercase letters] | Enter first word: hello Enter second word: HELLO HELLO hello |
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
