Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

The Temple Of Django Database Performance

Authors: Andrew Brookins

1st Edition

1734303700, 978-1734303704

More Books

Students also viewed these Databases questions