Question: In C++ please! Warning: do not use vectors in this exercise. Write a program that takes as input an array of 5 strings (single words
In C++ please!
Warning: do not use vectors in this exercise.
Write a program that takes as input an array of 5 strings (single words separated by spaces). The program then swaps the word that comes first alphabetically with the word that comes last, and print the resulting array. For example, if the input is
Alpha Bravo Charlie Delta Echo
The output will be
Echo Bravo Charlie Delta Alpha
If the input is
Bravo Echo Charlie Alpha Delta
then the output will be
Bravo Alpha Charlie Echo Delta
Hint: you may directly compare two string variables using > or
Any attempt to hard code answers will result in a 0 for the exercise.

Warning: do not use vectors in this exercise. Write a program that takes as input an array of 5 strings (single words separated by spaces). The program then swaps the word that comes first alphabetically with the word that comes last, and print the resulting array. For example, if the input is Alpha Bravo Charlie Delta Echo The output will be Echo Bravo Charlie Delta Alpha If the input is Bravo Echo Charlie Alpha Delta then the output will be Bravo Alpha Charlie Echo Delta Hint: you may directly compare two string variables using > or
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
