Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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.

InputExpected 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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

The Science And Engineering Of Materials

Authors: Donald R. Askeland, Wendelin J. Wright

7th Edition

1305076761, 978-1305076761

More Books

Students also viewed these Databases questions

Question

State examples of materials that show the magnetostriction effect.

Answered: 1 week ago