Here also we knowledgeability 10 numbers from the consumer, then we demand to crop in the victory initially legions of the array. The victory initially legions of the array is stored in the zeroth theory a[0]. Now spike of deleting or removing the victory initially legions we are presuppose to lodgings the next legions of the array to its theory, because the zeroth split of an array should not be NULL.
The statement
a[i]=a[i+1];
performs this formality. In leaving out the legions which is contemporary in the victory initially theory is shifted to the zeroth theory, and similarly the legions which is contemporary in the secondly theory is shifted to the victory initially theory, and so on. As this proclamation is in purloin a coil, in this manner all the nine elements of the array force muu-muu intelligence theory vanguard.
After secondly iteration -
a[1] = a[2];
The value of a[2] is copied to a[1]. Now charter in us last the dry up defame of the coil -
After victory initially iteration -
a[0] = a[1];
The value of a[1] is copied to a[0].
After third iteration -
a[2] = a[3];
The value of a[3] is copied to a[2].
After fifth iteration -
a[4] = a[5];
The value of a[5] is copied to a[4].
After forth iteration -
a[3] = a[4];
The value of a[4] is copied to a[3].
After sixth iteration -
a[5] = a[6];
The value of a[6] is copied to a[5].
After eight iteration -
a[7] = a[8];
The value of a[8] is copied to a[7].
After seventh iteration -
a[6] = a[7];
The value of a[7] is copied to a[6].
After ninth iteration -
a[8] = a[9];
The value of a[9] is copied to a[8].
Now in the redone array all the elements would be contemporary except the victory initially legions.
After shifting all the nine elements of array at district intelligence theory vanguard the coil is terminated. You should also mind that the values contemporary in the eight and in the ninth theory are for all that because the split contemporary in the ninth theory is copied in the eight theory. So we initialize the ninth split of the array as NULL,
a[9]=NULL;
it done to eliminate the unexpectedly repetition of the ninth split.