Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

8. Write a function array_subtract which subtracts a number x from every element

ID: 3654804 • Letter: 8

Question

8. Write a function array_subtract which subtracts a number x from every element of an array. For instance, if the array contains (1.5, 3.5, 1) and x equals 0.2, then the function changes the array to (1.3, 3.3, 0.8). The function should take three parameters, the number x, the array, and the number of elements in the array. The array parameter can either be declared as a fixed size array or as a variable size array. The function modifies the array but does not return any value. 9. In the main program, call the function find_min to get the value of the minimum number in the array. Print this minimum value. 10. In the main program, call the function array_subtract to substract the minimum value from each element of the array. Pass the minimum value computed in the previous step as the number x. Print the new values of the array. Note that at least one of the new values must be zero.

Explanation / Answer

//function array_subtract //**************************************************************** int array_subtract(int xx, int xarray[], int xsize) { int i; for (i = 1; i
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote