write a program to delete an item from a particular location
of an linear array?
Answer Posted / ajith.s uit adoor(2008-2011)
#include<stdio.h>
#include<conio.h>
void main()
{
int i,j,item,n,a[10],u,k;clrscr();
printf("enter the limit\n");
scanf("%d",&n);
if(n>=10)
{
printf("Array exceed limit .correct the limit value below
10 \n");
}
else
{
printf("enter the position\n");
scanf("%d",&k);
if(k<=n||k<=10)
{
printf("enter the terms\n");
for(i=1;i<=n;i++)
{
scanf("%d",&a[i]);
}
printf("inserted list\n");
for(i=1;i<=n;i++)
{
printf("%d\n",a[i]);
}
printf("inser list\n");
for(i=k;i<=n-1;i++)
{
a[i] =a[i+1];
}
for(i=1;i<n;i++)
{
printf("%d\n",a[i]);
}
}
else
{
printf("postion given in below limit not equal to \n");
}
}
getch();
}
| Is This Answer Correct ? | 5 Yes | 1 No |
Post New Answer View All Answers
What are header files in c programming?
What is 1d array in c?
What is structure in c definition?
What is c language used for?
What are the advantages and disadvantages of pointers?
How can you increase the size of a dynamically allocated array?
What is the purpose of scanf() and printf() functions?
Can a pointer be static?
Whats s or c mean?
write a program using linked list in which each node consists of following information. Name[30] Branch Rollno Telephone no i) Write the program to add information of students in linked list
What is #line in c?
How can you find the exact size of a data type in c?
what is the format specifier for printing a pointer value?
What is difference between function overloading and operator overloading?
while initialization of array why we use a[][2] why not a[2][]...?