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 stand for?

0 Answers  


Write a program in c to input a 5 digit number and print it in words.

11 Answers  


main() { int i=5; printf("%d",++i + i); } output is 10 ------------------------ main() { int i=5; printf("%d",i++ + i); }output is 12 why it is so? give appropiate reason....

2 Answers  


Find Index of least significant bit set in an Integer. ex. int value is say 10001000 results should be 4.

1 Answers  


in programming languages a statement or part of a statement that specifies several different execution sequences a) constructs b) distructs c) executes d) none

0 Answers  


regarding the scope of the varibles;identify the incorrect statement: a.automatic variables are automatically initialised to 0 b.static variables are are automatically initialised to 0 c.the address of a register variable is not accessiable d.static variables cannot be initialised with any expression

1 Answers   TCS,


write a program that print itself even if the source file is deleted?

2 Answers  


What does p mean in physics?

0 Answers  


What are the scope of static variables?

0 Answers  


What does int main () mean?

0 Answers  


What are global variables and explain how do you declare them?

0 Answers  


N O S I E R + A S T R A L ---------------- 7 2 5 6 1 3

3 Answers   Honeywell,


Categories