Question: Write a C program that will implement a function named compare _ arrays that takes two arrays of int values and returns an int value

Write a C program that will implement a function named compare_arrays that takes two arrays of int values and returns an int value computed as follows:
Find the smallest value in each of the array parameters (lets call them s1 and s2)
Find the biggest value in each of the array parameters (lets call them b1 and b2)
Compute and return x + y where x is the smallest of b1 and b2, and y is the largest of s1 and s2.
You will also implement a main method that will ask the user to enter values for two arrays and then display the result returned by compare_arrays. In order to make things a bit easier, we will assume that both arrays are always of the same size 3 that you will define using #define.

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 Programming Questions!