#include <stdio.h>
int main()
{
int arr[50], pos, c, n;
printf("Enter number of elements in array\n");
scanf("%d", &n);
printf("Enter %d elements\n", n);
for (c = 0; c < n; c++)
scanf("%d", &arr[c]);
printf("Enter the location where you wish to delete element\n");
scanf("%d", &pos);
if (pos >= n+1)
printf("Deletion not possible.\n");
else
{
for (c = pos - 1; c < n - 1; c++)
arr[c] = arr[c+1];
printf("Resultant array:\n");
for (c = 0; c < n - 1; c++)
printf("%d\n", arr[c]);
}
return 0;
}
OUTPUT :-
For
Other Programs Visit The WebSite:- https://www.techapurba.com/
Follow
Me On Social Media :-
Instagram
link :- https://www.instagram.com/apurba_khanra/
Facebook page link (Crazy Coders) :-https://www.facebook.com/codercrazy/?modal=admin_todo_tour
Facebook link :- https://www.facebook.com/profile.php?id=100009747586288
For tech related videos visit my other website :- https://apurbatechinfo.blogspot.com/
0 Comments