Question
pls help Write a method void remove(int *a, int index) that will remove the number at the given index and shift all remaining numbers one
pls help
Write a method void remove(int *a, int index) that will remove the number at the given index and shift all remaining numbers one position to the left in the array a. Assume 1that the last element of the array is -1. Now, write a main function that will define an array int A[40]=[3, 5, 9, 17, 24, -1]; read from user input an index; and call the method remove passing array A and the index given by the user. For example if user enters 2, then number 9 at index 2 will be removed and the array will now contain [3, 5, 17, 24, -1] Print the array after the removal. You MUST write the remove method using ONLY pointers and pointer arithmetic (no array notation [ ] allowed).
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started