#include<stdio.h>
void main()
{
int i,k;
int a[10];
printf("Enter the elements of array:");
for(i=0;i<10;i++)
{
scanf("%d",&a[i]);
}
printf("Enter the position no. of element you want to delete:");
scanf("%d",&k);
for(i=k-1;i<9;i++)
{
a[i]=a[i+1];
}
printf("The new array is:");
for(i=0;i<9;i++)
{
printf("%d ",a[i]);
}
getch();
}
void main()
{
int i,k;
int a[10];
printf("Enter the elements of array:");
for(i=0;i<10;i++)
{
scanf("%d",&a[i]);
}
printf("Enter the position no. of element you want to delete:");
scanf("%d",&k);
for(i=k-1;i<9;i++)
{
a[i]=a[i+1];
}
printf("The new array is:");
for(i=0;i<9;i++)
{
printf("%d ",a[i]);
}
getch();
}
No comments:
Post a Comment