In this exercise you will calculate the average between
every pair of integers of two arrays. You will have to print the integers of
the arrays and calculate and print that average. Create a file with name
basic_arrays.c
in your development environment and
implement the following functionality:
A function that prints out the integer values of an
array: void print_array(int array[]);
A second function that calculates the average between
the two elements in a same position of two arrays and prints that
average value: void calculate_average(int array1[], int
array2[]);
. For the first position in every array, sum the two
integers and divide the result by two, prints the result out and makes
the same for the rest of positions in the arrays.
A main
function that declares and
initializes the two arrays with 10 integers (whatever you want), such as
int array1[] = {1,5,7,3,12,...};
, and that makes use of the
first and second function to both print the values of the arrays and
print out the averages.
When finished, show the file to the professor.