Question: EXERCISE 2 . Write a function that prints all elements whose index is an odd number Use a for-loop Function - Name: odd_index_only Parameters: vector


EXERCISE 2 . Write a function that prints all elements whose index is an odd number Use a for-loop Function - Name: odd_index_only Parameters: vector Return: none EXERCISE 3 . Write a function that prints all elements whose value is an odd number Use a for-loop Function Name: odd_value_only . Parameters: vector Return: none EXERCISE 4 Define a vector of integers with 5 elements . Write the following functions . vector_sum . Given a vector, returns the sum of all its elements . vector_prod . Given a vector, returns the product of all its elements vector_max . Given a vector, returns the max value among all its elements vector_min . Given a vector, returns the min value among all its elements
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
