Write C code for a function called insert that will accept a

Write C++ code for a function called insert that will accept an array, the array size, array position and element to be inserted as arguments and insert the element correctly.

Solution

int[] insert(int a[],int size,int index,int element)
{
for(int i=index;i<size;i++)
{
a[i+1]=a[i];
}
a[index]=element;
return a;
}

Write C++ code for a function called insert that will accept an array, the array size, array position and element to be inserted as arguments and insert the ele

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site