Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

in C++ the first part it is the int main... do the function based off the parameters and show the output. Do both func5 and

in C++ the first part it is the int main... do the function based off the parameters and show the output. Do both func5 and func6

image text in transcribedimage text in transcribed

func5: ( 3 pts) - write a function that takes as input: an array of ints, thi length of an array, and an integer It returns: an int. - The functian should find the value in the array closest to the integer, and * return the index of that integer + Point: To make sure you understand how to update values in a Ioop +/ int func5 (int arr[], int val, int len) f / write function definition here %/ \} func6: ( 3p pts) - write a function that takes as input: an array of ints. the length of an array, and an integer (which acts as an index into the array). - It returns: - nathing- - The fuaction shauld find the snallest value in the array, and swap - that value with the value at the index integer. - For instance, if you've got the following array: - [3,3,5,1,2,7,6,9,4] * and the findex sent in was 7: - the stallest value in the array is 1 , at index 3. - The value at index 7 is 9 . Sa 1 and + 9 would be swapped in the array, resulting in: * [8,3,5,9,2,7,6,1,4] - Point: To make sure you can find (and update) the sallest value, and * can siapt ( int arr[], int ind, int len) \{ write function definition here / \}

Step by Step Solution

There are 3 Steps involved in it

Step: 1

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

Database Marketing The New Profit Frontier

Authors: Ed Burnett

1st Edition

0964535629, 978-0964535626

More Books

Students also viewed these Databases questions