#include<stdio.h>
#include<stdlib.h>
#include<conio.h>
void main()
{
clrscr();
int i,j,n1,n2,l,v,t,data[50],a[30];
char c;
printf("how many element u want:\t"); scanf("%d",&n1);
for(i=1;i<=n1;i++)
{
printf("data[%d]= ",i); scanf("%d",&data[i]);
}
again:
printf("\nEnter location to insert:\t"); scanf("%d",&l);
printf("\nHow many element u want:\t"); scanf("%d",&n2);
for(i=1;i<=n2;i++)
{
printf("a[%d]= ",i); scanf("%d",&a[i]);
}
//shifting//
for(i=(n1+n2),j=0;i>=n2+l;i--,j++)
{
data[i]=data[n1-j];
}
//entering value//
for(i=0;i<n2;i++)
{
data[l+i]=a[i+1];
}
//display//
for(i=1;i<=n1+n2;i++)
{
printf("data[%d]=%d\n",i,data[i]);
}
printf("\ninsert again ? (y/n)..");
c=getch();
if(c=='y')
{
n1=n1+n2;
goto again;
}
else
exit(0);
}