Write a complete C program to declare two one-dimensional arrays, each with 10 integer data items. Then, write a function called readData()¸to read the data items into each array separately. Once the data have been read into each array, you are required to write another function called printLarger(), which prints the contents of an array which is larger than the other array. In other words, you are required to calculate the sum of all the data items in each array, and then compare these sums. If the sum of the first array is larger than the sum of the second array, then you should print the message “array A is larger than array B”, and then print the contents and sum of array A, and vice versa. You can use any names for the arrays as long as they are meaningful. Note that you are required to pass the arrays to the respective functions by reference.
1
Expert's answer
2013-03-05T10:43:09-0500
Unfortunately, your question requires a lot of work and cannot be done for free. Submit it with all requirements as an assignment to our control panel and we'll assist you.
Comments
Leave a comment