WRITE AN ALGORITHM TO INSERT AN ELELEMENT IN AN ARRAY. WAP TO INSERT AN ELEMENT IN AN ARRAY . [SPECIFY THE OUTPUT]
Answers
Answered by
0
Answer:
To insert new element in array, shift elements from the given insert position to one position right. Hence, run a loop in descending order from size to pos to insert. The loop structure should look like for(i=size; i>=pos; i--) . Inside the loop copy previous element to current element by arr[i] = arr[i - 1]
Similar questions