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 are run-time errors?

0 Answers  


What is wild pointer in c?

0 Answers  


Which is the best website to learn c programming?

0 Answers  


Write a program to check palindrome number in c programming?

0 Answers  


How does the C program handle segmentation faults?

2 Answers  


11. Look at the Code: #include<string.h> void main() { char s1[]="abcd"; char s2[10]; char s3[]="efgh"; int i; clrscr(); i=strcmp(strcat(s3,ctrcpy(s2,s1))strcat(s3,"abcd")); printf("%d",i); } What will be the output? A)No output B) A Non Integer C)0 D) Garbage

7 Answers   Accenture,


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?

0 Answers   HCL,


What are type modifiers in c?

0 Answers  


Why is sizeof () an operator and not a function?

0 Answers  


a=5 a=a++/++a

14 Answers   Bhel,


is assignment operator is arithmatic or not

3 Answers   Infosys,


Explain how can type-insensitive macros be created?

0 Answers  


Categories