10.1 Write a template function that returns the average of all the elements of an array. Thearguments to the function should be the array name and the size of the array (type int). In main (),exercise the function with arrays of type int, long, and double.
10.2 Create a function called amax() that returns the value of the largest element in an array. Thearguments to the function should be the address of the array and its size. Make this function into atemplate so it will work with an array of any numerical type. Write a main () program that appliesthis function to arrays of various types.
Already registered? Login
Not Account? Sign up
Enter your email address to reset your password
Back to Login? Click here