#include<stdio.h>
#include<conio.h>
void main()
{
int p[5],q[3],r[8],i,j;
clrscr();
printf("enter the elements of an array P-\n");
for(i=0;i<5;i++)
scanf("%d",&p[i]);
printf("enter the elements of an array Q-\n");
for(i=0;i<5;i++)
scanf("%d",&q[i]);
printf("After joining P and Q..............-\n");
for(i=0;i<5;i++)
r[i]=p[i];
for(j=0;j<3;j++)
{
r[i]=q[j];
i++;
}
printf("Total elements of an array R-\n");
for(i=0;i<8;i++)
printf("%d\n",r[i]);
getch();
}