C++ Programming Code Examples C++ > Arrays and Matrices Code Examples Delete an element in an array from specific position Delete an element in an array from specific position #include<iostream.h> #include<conio.h> void main() { int j,a[5],no,pos; clrscr(); cout<<"Enter data in array: "; for(j=0;j<5;j++) { cin>>a[j]; } cout<<"\n\nStored Data in array: "; for(j=0;j<5;j++) { cout<<a[j]; } cout<<"\n\nEnter poss. of element to delete: "; cin>>pos; if(pos>5) { cout<<"\n\nThis value is out of range: "; } else { --pos; for(j=pos;j<=4;j++) { a[j]=a[j+1]; } cout<<"\n\nNew data in array: "; for(j=0;j<4;j++) { cout<<a[j]; } } getch(); }