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 |
How many static variables are created if you put one static member into a template class definition?
What are the techniques you use for debugging?
what is pre-processor in C++?
What is fixed in c++?
Should I learn c++ c?
Difference between pointer to constant and constant pointer to a constant. Give example.
Explain how the virtual base class is different from the conventional base classes of the opps.
what is smart pointer & use of the smart pointer ???
What is the difference between global variables and static varables?
Write a corrected statement in c++ so that the statement will work properly. if (4 < x < 11) y=2*x;
I want to write a C++ language program that: 1. Reads in the size of a square from the screen; 2. Prints a hollow square of that size out of “-“, “|” and blanks on screen; 3. Prints the same hollow square onto a text file. The program should work for squares of all side sizes between 1 and 20.
let a,b,c be three integer numbers.write a c++ program with a function void rotate 1()such that a->b->c and c->a.