by Dinesh Thakur Category: Array
#include <stdio.h>

#include <conio.h>
int main()
{
    int i, n, pos, arr [10];
    clrscr ();
    printf("\n Enter the size of the array:");
    scanf("%d",&n);
    printf("\n Enter the elements of the array: ");
  for(i=0;i<n;i++)
  {
    scanf("%d", &arr[i] );
  }
    printf("\n Enter the position from which the number has to be deleted: ");
    scanf ("%d", &pos );
  for(i= pos; i<n;i++)
  {
    arr[i] = arr [i+1];
    n--;
    printf("\n The array after deletion is:");
  }
    for(i=0;i<n;i++)
    {
      printf("\n Arr[%d] = %d", i, arr[i]);
    }
      getch();
      return 0;
}

delete a number from a given location in an array



About Dinesh Thakur

Dinesh ThakurDinesh Thakur holds an B.SC (Computer Science), MCSE, MCDBA, CCNA, CCNP, A+, SCJP certifications. Dinesh authors the hugely popular blog. Where he writes how-to guides around Computer fundamental , computer software, Computer programming, and web apps. For any type of query or something that you think is missing, please feel free to Contact us.



Related Articles