63 839
Assignments Done
99,2%
Successfully Done
In August 2018

Answer to Question #37314 in Other Programming & Computer Science for Jim

Question #37314
Write a program largeHalf.c that takes in a list of 8 integers, splits the list into two halves (first 4 elements, last 4 elements), sums the elements in each half, selects the half with the larger sum, and then repeats this process with the selected list until there is only one element selected. The program should print out the half selected at each step. If the two halves have equal sum, the program should tell the user this and should always pick the first half (the one with a smaller starting index, see the example output below). Your program must include the following functions: int sumArray(int array[], int startIdx, int len) - Returns the sum of the elements in array with index startIdx to startIdx+len. void printArray(int array[], int startIdx, int len) - Print the elements in array with index startIdx to startIdx+len.
Expert's answer
Dear visitor,
What programming language should we use?

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be first!

Leave a comment

Ask Your question

Submit
Privacy policy Terms and Conditions