Paste Search Dynamic
Recent pastes
Resultant array
  1. #include <stdio.h>
  2. int main()
  3. {
  4.    int array[100], position, c, n;
  5.  
  6.    printf("Enter number of elements in arrayn");
  7.    scanf("%d", &n);
  8.  
  9.    for (c = 0; c < n; c++)
  10.       scanf("%d", &array[c]);
  11.  
  12.    printf("Enter the location where you wish to delete elementn");
  13.    scanf("%d", &position);
  14.  
  15.    if (position >= n+1)
  16.       printf("Deletion not possible.n");
  17.    else
  18.    {
  19.       for (c = position - 1; c < n - 1; c++)
  20.          array[c] = array[c+1];
  21.  
  22.       printf("Resultant array:n");
  23.  
  24.       for (c = 0; c < n - 1; c++)
  25.          printf("%dn", array[c]);
  26.    }
  27.  
  28.    return 0;
  29. }
Parsed in 0.005 seconds