write a program to delete an item from a particular location
of an linear array?



write a program to delete an item from a particular location of an linear array?..

Answer / 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

More C Interview Questions

What does c mean before a date?

0 Answers  


What does the error message "DGROUP exceeds 64K" mean?

0 Answers   Celstream,


Explain what is the difference between declaring a variable and defining a variable?

1 Answers  


what is answer for perfect number????????????????

1 Answers  


What is || operator and how does it function in a program?

0 Answers  






WHAT IS THE DEFINATION OF IN TECHNOLOGY AND OFF TECHNOLOGY ?

0 Answers   HP,


What is the difference between fread buffer() and fwrite buffer()?

0 Answers  


what is the return type of printf

3 Answers  


main() { int x=5; printf("%d %d %d\n",x,x<<2,x>>2); }

11 Answers   CISOC, CitiGroup, College School Exams Tests,


When was c language developed?

0 Answers  


What is Conio.h ?

2 Answers   TCS,


Explain how do you generate random numbers in c?

0 Answers  


Categories