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 |
Differentiate between realloc() and free().
what are the iterator and generic algorithms.
Define upcasting.
What are member functions used in c++?
Name the implicit member functions of a class.
What is function prototyping?
What is an undefined behavior and sequence points
Difference between Top down and bottom up approaches for a given project ?
14 Answers BSNL, CSC, HCL, HP, IIT, Infosys, Siemens,
What is the difference between mutex and binary semaphore?
Is c++ a software?
reading material is provided 3 books for c++ if u need more do let me know thnx i hve lots of material do let me know if u want it
Where do I find the current c or c++ standard documents?