Question: In C++ please! Write a program that takes three letters (either capital or lowercase) as input then outputs them in the ascending order based on

In C++ please!

Write a program that takes three letters (either capital or lowercase) as input then outputs them in the ascending order based on their ASCII values. Note that letter 'A' has the smallest ASCII value, followed by 'B', until lowercase 'z'. For example, if the user inputs

a A b 

the program will output

A a b 

Hint: declare three char variables to accept the user input of three letters, then compare these three letters using operator like how you will compare three numbers to determine their output order. Think of three numbers n1, n2, n3, what could be the possible cases (e.g., n1>n2>n3, n1>n3>n2, n2>n1>n3, )?

Any attempt to hard code answers will result in a 0 for the exercise.

In C++ please! Write a program that takes three letters (either capital

Write a program that takes three letters (either capital or lowercase) as input then outputs them in the ascending order based on their ASCII values. Note that letter 'A' has the smallest ASCII value, followed by 'B', until lowercase 'z'. For example, if the user inputs a Ab the program will output A a b Hint: declare three char variables to accept the user input of three letters, then compare these three letters using operator like how you will compare three numbers to determine their output order. Think of three numbers ni, n2, n3, what could be the possible cases (e.g., n1>n2>n3, n1>n3>n2, n2>nl>n3, ...)? Any attempt to hard code answers will result in a 0 for the exercise

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!