An array is a collection of items stored at contiguous memory locations. In this article, we will see how to insert an element in an array in C.
Given an array arr of size n, this article tells how to insert an element x in this array arr at a specific position pos.
Output:
Enter no. of elements you want for the array:
5
Enter 5 elements for the array:
23
65
36
14
52
Enter the element you want to insert:
65
Enter position for the newitem element:
3
Array after inserting newitem element
23 65 65 36 14 52
need an explanation for this answer? contact us directly to get an explanation for this answer