#include<iostream.h>
#include<conio.h>
int main()
{
int a[5],loc,val,ans;
do
{
cout<<" enter the elements "<<endl;
for(int i=0;i<5;i++)
cin>>a;
cout<<" enter the location u want to edit with respect to zero ";
cin>>loc;
cout<<" enter the val to be inserted ";
cin>>val;
for(int j=6;j<0;j--)
{ if(j==loc)
a[j]=val;
else if(j>loc)
a[j]=a[j-1];
}
for(int k=0;k<6;k++)
cout<<a[k]<<endl;
cout<<" press y to continue ";
cin>>ans;
}while(ans=='y'||ans=='Y');
}
sahil_logic 0 Light Poster
HyperEngineer 0 Newbie Poster
sahil_logic 0 Light Poster
Asif_NSU 25 Posting Whiz
Asif_NSU 25 Posting Whiz
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.