#include<stdio.h>
int deletearr(int n)
{
int pos, num , a[1000] , i , j, k;
num =n;
printf("Enter the %d elements :",num);
for(i=0;i<num;i++)
{
scanf("%d", &a[i]);
}
printf(" Enter the position of the array to be deleted :\t");
scanf("%d",&pos);
k=num+1;
if(pos>=k)
{
printf("\n It Is Not Possible To Delete The Array");
}
else
{
for(i = pos-1; i<num-1; i++)
a[i] = a[i+1];
printf(" The Final Array is : \t ");
for(i=0 ; i<num-1 ; i++)
{
printf("%d\t",a[i]);
}
}
return 0;
}
int main()
{
int n, x ;
printf(" Enter the number of elements : ");
scanf("%d",&n);
x=deletearr(n);
return 0;
}
OUTPUT : -
For Other Programs Visit The WebSite:- https://www.techapurba.com/
Follow Me On Social Media :-
INSTA photography page :- https://www.instagram.com/photo_mania_hub/
Twitter link : - https://twitter.com/ApurbaKhanra199
Facebook page link (Crazy Coders) :-https://www.facebook.com/codercrazy/?modal=admin_todo_tour
Insta photography link :- https://www.instagram.com/photo_mania_hub/
Facebook link :- https://www.facebook.com/profile.php?id=100009747586288
FB photography page :- https://www.facebook.com/photomaniahub/?modal=admin_todo_tour
For tech related videos visit my other website :- https://apurbatechinfo.blogspot.com/
0 Comments