Question: Write a function with name getEvenNumbers . The purpose of the function is to process an input array of int typed integers and return the
Write a function with name getEvenNumbers. The purpose of the function is to process an input array of int typed integers and return the list of even numbers in the array. The function needs to be able to handle input arrays with arbitrary lengths. The return type of the function must be "int *", or pointer to int, namely that the function returns a pointer pointing to the memory storing the list of even numbers. No global variables are allowed. Except for these requirements, you are free to design the function. You also need to write a testing program (namely a main function) to show your design and implementation of this function are correct. Your testing program needs to do the following: first it asks the user to enter a positive integer N, then it generates a length-N array of random integers; then calls your function getEvenNumbers to get the list of even numbers in this array, and finally prints the list.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
