#include <stdio.h>
int main()
{
int n=5;
int arr[n], p;
printf("Enter %d elements\n", n);
for (int i = 0; i < n; i++)
scanf("%d", &arr[i]);
printf("Enter the location where you wish to delete element\n");
scanf("%d", &p);
if (p >= n+1)
printf("Impossible.\n");
else
{
for (int i = p - 1; i < n - 1; i++)
arr[i] = arr[i+1];
}
arr[p]=46;
return 0;
}
Comments
Leave a comment