Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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... blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Introduction to Java Programming, Comprehensive Version

Authors: Y. Daniel Liang

10th Edition

133761312, 978-0133761313

More Books

Students also viewed these Programming questions

Question

Why is it so important to have good data?

Answered: 1 week ago

Question

Define and contrast MAD, MSE, and MAPE.

Answered: 1 week ago