An array is a systematic arrangement of objects, usually in rows and columns. ‘Deleting’ elements from an array might mean two things: deleting the value for a particular index (or indices) in the array (while still leaving the slot in the array open), or, actually removing a slot (and its contents) from the array.
Language : C
[sourcecode language='c']
//TO DELETE AN ELEMENT OF AN ARRAY
#include
#include
void main()
{
int i,a[10],p,size;
char ch;
size=10;
clrscr();
do{
printf(“Enter the 10 elements of array”);
for(i=0;i<10;i++)
{
scanf(“%d”,&amp;a[i]);
}
printf(“\nEnter the position to delete the elemaent of array”);
scanf(“%d”,&amp;p);
for(i=p;i<=size-1;i++)
{
a[i]=a[i+1];
}
printf(“\n The new array is \n”);
for(i=0;i<=size-1;i++)
{
printf(“%d”,a[i]);
}
fflush(stdin);
printf(“\n\n Do you want to continue y/n”);
scanf(“%c”,&amp;ch);
}while(ch==’y');
}
[/sourcecode]






