I'm having issues with this homework problem. Can someone assist? I've started it out I just need a hint or help
The remove function must remove the first occurrence of the passed integer value, if found, and shift each following element to the left and add a zero at the end of the array then call the remove function from the main function and display the content of the array after the call.
#include <iostream>
usingnamespace std;
int search(int arr[], int size, int val);
bool remove(int take[], int s, int v);
constint SIZE =25;
int main()
{
int nums[SIZE]; // array declaration
int found;
int n;
//initialize array nums
for (int i = 0; i < SIZE; i++)
{
nums[i] = rand( ) % 251;
}
// display the content of array nums
cout << "\n************************\n";
for (int i = 0; i < SIZE; i++)
{
cout << nums[i] << "\t";
}
cout << "\n************************\n";
cout << "please enter a number between 0 to 250" << endl;
cin >> n;
found = search(nums, SIZE, n);
if (found != -1)
cout << n << " was found in our data set!\n";
else
cout << n << " was NOT found in our data set!\n";
return 0;
}
int search (int nums[], int SIZE, int n)
{
for (int i = 0; i < SIZE; i++)
{
if (nums[i] == n)
return i;
}
return -1;
}