Question
Write a program to declare an array of size 10 and initialize itwith random values in the range 1 to 54. Pass this array as
Write a program to declare an array of size 10 and initialize itwith random values in the range 1 to 54. Pass this array as well asthe size to a function called reverse. The function reverse shoulddisplay the values in reverse order.
Example if the random values are the following:
34 | 53 | 6 | 2 | 46 | 22 | 1 | 2 | 30 | 29 |
The function should display the values as:
29 30 2 1 22 46 2 6 53 34
Write a different function that finds the median of these values. In other words you should sort this array and find the middle value. Again in main you should pass this array to this function as well as the size.
In main call reverse again—now reverse should display the values in sorted form but in reverse order of how you sored them.
Display the largest value and smallest value. Now that thevalues are sorted this should be just one line.
Step by Step Solution
3.61 Rating (169 Votes )
There are 3 Steps involved in it
Step: 1
include include include include void reverseint arr int size for int i size 1 i 0 i stdcout arri std...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