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 are the vectors in c++?
If dog is a friend of boy, and terrier derives from dog, is terrier a friend of boy?
How do I run a program in notepad ++?
What are libraries in c++?
What is meaning of in c++?
Distinguish between a # include and #define.
Is c++ a programming language?
What are the methods of exporting a function from a dll?
What is an associative container in c++?
difference between the c++ and c languages
There is a magic square matrix in such a way that sum of a column or a row are same like 3 5 2 4 3 3 3 2 5 sum of each column and row is 10. you have to check that matrix is magic matrix or not?
How do you instruct your compiler to print the contents of the intermediate file showing the effects of the preprocessor?