Question: Write a C++ program that creates a random array of integer numbers from 1 10. Then, move all of the 7s to the front of
Write a C++ program that creates a random array of integer numbers from 1 10. Then, move all of the 7s to the front of the array. The order of the other numbers is not important as long as all numbers follow the group of Lucky 7s. Output both the random array and the sorted array. Assume array size is 20 or less. A selection or insertion sort must be used in the problem. Refer to the sample output below. Sample Run: Random Input: [1, 10, 9, 2, 8, 2, 5, 6, 10, 7, 9, 8, 6, 7, 2, 7, 6, 10, 5, 3] Output array: [7, 7, 7, 2, 8, 2, 5, 6, 10, 1, 9, 8, 6, 10, 2, 9, 6, 10, 5, 3]
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
