Write a function that removes all even numbers from an


Write a function that removes all even numbers from an array. The function should take the array, length of the array, and a pointer for number of odd numbers found as arguments and return a pointer to the new array. If there are no odd numbers found in the array, your code should print "No odds found." and return NULL.

Use the function header:

int *removeEvens(int *a, int length, int *oddsFound);

Example:

Input array a[ ] = {3, 4, 5, 6, 7}
*oddsFound = 3
return array = {3, 5, 7}

The size of the return array needs to be the number of odd numbers found.

Note: You can determine if a number is even by checking if a[x] % 2 == 0.

Request for Solution File

Ask an Expert for Answer!!
Basic Computer Science: Write a function that removes all even numbers from an
Reference No:- TGS02191405

Expected delivery within 24 Hours