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
How do you print only part of a string?
Explain is it valid to address one element beyond the end of an array?
What is a good way to implement complex numbers in c?
write a program to copy the string using switch case?
Mention four important string handling functions in c languages .
What are the usage of pointer in c?
Describe the complexity of Binary search, Quicksort and various other sorting and searching techniques..
Why do we use main function?
How can I convert a number to a string?
Explain what is wrong with this program statement? Void = 10;
What is pointer to pointer in c language?
How can I remove the leading spaces from a string?
What is main () in c?
how to solve "unable to open stdio.h and conio.h header files in windows 7 by using Dos-box software
Describe the header file and its usage in c programming?