476 Programming and Data Structures
ends. In this case, due to lack of space, insertion operation is impossible.
The position number where an element is to be inserted and the element are prompted by the
program. After the user enters these values, using while loop, the position of the first vacant location
is determined. From user specified, position number, next all successive elements are shifted one
memory location towards down side of array. Due to this shifting, space is generated and the entered
element is placed at that location.
Like insertion, deletion of an element can be done from the list. In deletion, the elements are moved
upwards by one position.
14.5 Write a program to create a list of integec elements Delete the specified element from
ft inaluda <at<Uo.,2s>
P include <conio.h>
| Inaludt <proc«*8.h>
u i n t)
printf ("\n Inter elements ( 0 to exit ) : ■ );
if < 0)
printf (B\n Enter am element to remove : *);
while (nvun[k] 1 »n)
printf (■ %d ", num[j]);
Enter elements ( 0 to exit): 58942347