Enter n no. of element and delete value from desire position
Answer / ruchi
#include<stdio.h>
#include<conio.h>
int main()
{
int n,pos,i,a[20];
printf("\nEnter how many elements are there in an array ");
scanf("%d",&n);
printf("\nEntert the elements ");
for(i=0;i<n;i++)
{
scanf("%d",&a[i]);
}
printf("\nEnter the position from where u want to delete
an item ");
scanf("%d",&pos);
pos=pos-1;
for(i=0;i<n;i++)
{
if((i==pos)&&(i!=n-1))
{
i=i+1;
}
if((i==pos)&&(i==n-1))
break;
printf("%d\n",a[i]);
}
getch();
}
| Is This Answer Correct ? | 2 Yes | 0 No |
What is searching?
If I is an integer variable, which is faster ++i or i++?
What are the two types of polymorphism?
What is ios flag in c++?
What is an associative container in c++?
What issue do auto_ptr objects address?
What is the difference between an enumeration and a set of pre-processor # defines?
What is constructor c++?
What is an operator in c++?
They will ask u question about single linked list?. Write Code for to insert delete node.
Explain calling an object's member function(declared virtual)from its constructor?
What is java and c++?