C Program to Insert an Element in an Array

Insert an Element in an Array

Here, you will get a program to insert an element in an array in c language. In this program you can inserts an element into the ArrayList at the specified index. If you want you can insert element at the beginning, or in between, or at the end.

Follow the following steps to complete the program:-

Step 1 Create an array list and input some numbers.

Step 2 Input location and value of element (to insert in Array List).

Step 3 Start a loop till location to be found, insert new value, and continue loop till end and shift element to next position.

Step 4 Print the array list.

Program to Insert an Element in an Array

Output

Enter the size of the array : 5

Enter elements of array : 2 4 8 10 12

Enter the location of the element to insert : 3

Enter element value to insert : 6

Array elements are : 2 4 6 8 10 12

 

 

Check out our other C programming Examples

 

 

 

 

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top