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 is the difference between fread and fwrite function?
When should a far pointer be used?
Tell us something about keyword 'auto'.
What is union and structure?
How are variables declared in c?
Can you explain the four storage classes in C?
Differentiate Source Codes from Object Codes
a character or group of characters that defines a register,or a part of storage a) memory b) byte c) address d) linear list
How can you increase the size of a statically allocated array?
What is ## preprocessor operator in c?
What is the difference between far and near ?
What is the significance of scope resolution operator?
How do you determine a file’s attributes?
hai iam working in sap sd module for one year and working in lumax ind ltd in desp department but my problem is i have done m.b.a in hr/marketing and working sap sd there is any combination it. can you give right solution of my problem. and what can i do?
what are the 10 different models of writing an addition program in C language?