Answer:
int withinArray(int * intArray, int size, int * ptr) {
if(ptr == NULL) // if ptr == NULL return 0
return 0;
// if end of intArr is reached
if(size == 0)
return 0; // element not found
else
{
if(*(intArray+size-1) == *(ptr)) // check if (size-1)th element is equal to ptr
return 1; // return 1
return withinArray(intArray, size-1,ptr); // recursively call the function with size-1 elements
}
}
Explanation:
Above is the completion of the program.