Question: Modify the program 1 2 - 1 0 from pages 8 3 9 as follows: 1 . Add a third C - string as name
Modify the program from pages as follows:
Add a third Cstring as nameNAMELENGHT
Add a pair of coutcingetline for the third string similar to the ones for first and second strings.
Add the appropriate case to the ifelse if structure such that the three strings will be displayed in alphabetical order.
Hint: There are possible cases factorial for all complete permutations. The easiest way to test is to input the three strings as single letters like: ab and c Your ifelse if condition check should cover all cases for the possible input order like: abc, acb, bac, bca, cab, cba. Regardless of the input order the output should be always abc.
First if condition check is like:
if strcmpnamename && strcmpnamename
cout name name name endl;
else if strcmp
You have to complete the rest of the "else if condition. The last "else" can be used to display the message that all three strings are the same.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
