( datadata[ data[ data[ data[ data[ data[ data[ data[ data[ data[ algorithm to insert an element in the middle of an array the algorithm insert will be declared as insert (anposvalthe arguments are (aathe array in which the element has to be inserted (bnthe number of elements in the array (cposthe position at which the element has to be inserted (dvalthe value that has to be inserted in the algorithm given in fig in step we step [initializationset first initialize with the total number of elements step repeat steps and while >pos in the array in step while loop is executed step set [ [iwhich will move all the elements having an index step set [end of loopgreater than pos one position towards right to create step set space for the new element in step we increment step set [posval the total number of elements in the array by and step exit finally in step the new value is inserted at the desired position figure algorithm to insert an element in the middle of an array nowlet us visualize this algorithm by taking an example initial data[is given as below datadata[ data[ data[ data[ data[ calling insert (data will lead to the following processing in the array datadata[ data[ data[ data[ data[ data[ datadata[ data[ data[ data[ data[ data[ datadata[ data[ data[ data[ data[ data[ datadata[ data[ data[ data[ data[ data[ programming examples write program to insert number at given location in an array #include