Friday, 28 October 2016

DELETION OF ELEMENT IN ARRAY


#include<stdio.h>
#include<conio.h>
main()
{
int n,a[100],i,j,d;
printf("enter the size of array\n");
scanf("%d",&n);
printf("enter the elements of array\n");
for(i=0;i<n;i++)
{
scanf("%d",&a[i]);
}
printf("enter the place to delete");
scanf("%d",&d);
printf("elements after deletion\n");
for(i=d-1;i<n;i++)
{
a[i]=a[i+1];
}
for(i=0;i<n-1;i++)
{
printf("%d\n",a[i]);
}
getch();
}

No comments:

Post a Comment