Question: Your program must ask the user to enter three letters of the alphabet (lowercase or uppercase) in any order. The user must be able to
Your program must ask the user to enter three letters of the alphabet (lowercase or uppercase) in any order. The user must be able to enter the three letters one right after the next, or with whitespace between each, or with each letter on a newline (i.e. enter/return after each letter). The program must then print out those three letters in alphabetical order on a new line. For example, user entries of krd or k r d or k r d should all result in a program output of dkr. Your program should use variables of type char. Note that char variables are stored in memory by their ASCII code (see slides 8-9 of Lecture 5). Since the numerical order of the ASCII codes is equivalent to the alphabetical order of the characters represented by these ASCII codes, alphabetical order can be determined by simply comparing the letters entered as if they were numbers. For the purpose of this assignment, assume that uppercase letters come before lowercase letters. For example: aBc should result in Bac bBA should result in ABb Your program must interact with the user and produce output exactly as follows (note the spaces and spelling). The example below shows program output if the user enters pfR. Enter any three letters from the alphabet in any order. pfR Rfp
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
