Write a function, remove, that takes three parameters: an array of integers, the number of elements in the array, and an integer (say, removeItem). The function should find and delete the first occurrence of removeItem in the array. (Note that after deleting the element, the number of elements in the array is reduced by 1.) Assume that the array is unsorted. Also, write a program to test the function. Your program should prompt the user to enter 10 digits for the array. Display the starting array to the user and prompt them to select an integer to remove. After the selected integer has been removed, the updated list should be displayed to the user. If the value does not exist or the array is empty, output the following message: x is not in the list
Write a function, remove, that takes three parameters: an array of integers, the number of elements in the array, and an integer (say, removeItem). The function should find and delete the first occurrence of removeItem in the array.
(Note that after deleting the element, the number of elements in the array is reduced by 1.) Assume that the array is unsorted.
Also, write a
x is not in the list
Trending now
This is a popular solution!
Step by step
Solved in 3 steps with 3 images