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
Disadvantages of C language.
Explain what is #line used for?
Using functions, write a program that multiplies two arrays. Use the following functions: - Function ReadArray - Function MultiplyArrays - Function DisplayArrays
Why is c used in embedded systems?
What is a newline escape sequence?
what do the 'c' and 'v' in argc and argv stand for?
What does c mean?
Write a program to print factorial of given number without using recursion?
The difference between printf and fprintf is ?
typedef struct{ char *; nodeptr next; } * nodeptr ; What does nodeptr stand for?
what do you mean by enumeration constant?
What is meant by inheritance?
How can I insert or delete a line (or record) in the middle of a file?
What is the benefit of using an enum rather than a #define constant?
Why is it usually a bad idea to use gets()? Suggest a workaround.