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.
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 exerciseStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started