Question: Based on findMin, Write a small function called int range ( int [ ] arr ) that uses a single for - loop to find

Based on findMin, Write a small function called int range(int []arr) that uses a single for-loop to find the max and min of of arr and then returns the difference of those values. For example, with an array {1,3,5}, range should return 5-1 which is 4.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!