Insertion and Deletion of data element on array

Insertion Operation

Insert operation is to insert one or more data elements into an array. Based on the requirement, a new element can be added at the beginning, end, or any given index of array.
Here, we see a practical implementation of insertion operation, where we add data at the end of the array 
Algorithm:

Deletion Operation

Deletion refers to removing an existing element from the array and re-organizing all elements of an array.

Source code:

#include<iostream>
#include<conio.h>
using namespace std;
main()
{

int input,arr[10],n,num,po,position;
char retry;
a:
cout<<"How many number you want to store(enter less than 10):";
cin>>n;

cout<<"Enter number you want to store:";
for(int i=0;i<n;i++)
cin>>arr[i];
 
cout<<endl;
cout<<"Make decision"<<endl;
     cout<<"_____________________*****____________"<<endl;
cout<<"Enter 1 to insert array in first:"<<endl;
cout<<"Enter 2 to insert array in middle position:"<<endl;
cout<<"Enter 3 to insert array in Last:"<<endl;
cout<<"Enter 4 to delete the variable in first position:"<<endl;
cout<<"Enter 5 to delete the variable in middle position:"<<endl;
cout<<"Enter 6 to delete the variable in last position:"<<endl;
cout<<"Enter 7 to exit"<<endl;
cin>>input;
switch(input)
{
case 1:
cout<<"Enter number you want to insert:";
cin>>num;

for(int i=n;i>0;i--)
{
arr[i]=arr[i-1];
}
arr[0]=num;
cout<<"Newly formed array after insertion in the first position is :";
for(int i=0;i<=n;i++)
cout<<arr[i]<<" ";
break;

case 2:
   cout<<"Enter number you want to insert:";
  cin>>num;
  cout<<"Enter the positon where you want to insert array:";
  cin>>po;
  position=po-1;
for(int i=n;i>po;i--)
{
arr[i]=arr[i-1];
}
arr[position]=num;
cout<<"Newly formed array after insertion in the first position is :";
for(int i=0;i<=n;i++)
cout<<arr[i]<<" ";
break;

  case 3:
  cout<<"Enter number you want to insert:";
  cin>>num;
arr[n]=num;
cout<<"Newly formed array after insertion in the first position is :";
for(int i=0;i<=n;i++)
cout<<arr[i]<<" ";
break;

    case 4:
for(int i=0;i<(n-1);i++)
{
arr[i]=arr[i+1];
}
cout<<"Newly formed array after deletion in the first position is :";
for(int i=0;i<(n-1);i++)
cout<<arr[i]<<" ";
break;

  case 5:
    cout<<"Enter the positon where you want to delete number: ";
  cin>>po;
for(int i=(po-1);i<(n-1);i++)
{
arr[i]=arr[i+1];
}
cout<<"Newly formed array after deletion  is :";
for(int i=0;i<(n-1);i++)
cout<<arr[i]<<" ";
break;

  case 6:

cout<<"Newly formed array after deletion in the last position is :";
for(int i=0;i<(n-1);i++)
cout<<arr[i]<<" ";

break;
   
     case 7: 

     
      default:
      cout<<"Wrong input";
        break;

}
cout<<endl<<"if u want to retry it press 'a' :";
cin>>retry;
 if(retry=='a')
{
goto a;
}
else
{

cout<<"Thank for your patience";
}

}