C++ program to Insert and Delete element of an array

Write a program to Insert and Delete element of an array


C++ program to Insert and Delete element of an array | Add Elements in Given Array | Run time Array Size Input 



    #include
    #include
    void main()
    {
    clrscr();
    int a[100],i,pos,num,item,size;
    cout<<"How many element: ";
    cin>>size;
    cout<<"Enter the elements of array: "<>a[i];
    cout<>num;
    cout<<"Enter position number: ";
    cin>>pos;
    cout<=pos;i--)
    a[i+1]=a[i];
    a[pos]=num;
    size++;
    cout<<"New Array: "<>pos;
    --pos;
    item=a[pos];
    for(i=pos;i


1 comment: